diff --git a/solvers/specific_options.cc b/solvers/specific_options.cc
index 3399c4bd0e39..bb65b91bd473 100644
--- a/solvers/specific_options.cc
+++ b/solvers/specific_options.cc
@@ -5,6 +5,8 @@
 #include <unordered_map>
 #include <vector>
 
+#include <fmt/ranges.h>
+
 #include "drake/common/overloaded.h"
 
 namespace drake {