diff --git a/include/http_utility.hpp b/include/http_utility.hpp
index eb54d0b..2fd5e14 100644
--- a/include/http_utility.hpp
+++ b/include/http_utility.hpp
@@ -8,6 +8,7 @@
 #include <cctype>
 #include <iomanip>
 #include <ostream>
+#include <ranges>
 #include <span>
 #include <string>
 #include <string_view>
@@ -75,10 +76,9 @@
         {
             return ContentType::ANY;
         }
-        const auto* knownContentType =
-            std::find_if(contentTypes.begin(), contentTypes.end(),
-                         [encoding](const ContentTypePair& pair) {
-            return pair.contentTypeString == encoding;
+        const auto* knownContentType = std::ranges::find_if(
+            contentTypes, [encoding](const ContentTypePair& pair) {
+                return pair.contentTypeString == encoding;
             });
 
         if (knownContentType == contentTypes.end())
@@ -88,8 +88,9 @@
         }
 
         // Not one of the types requested
-        if (std::find(preferedOrder.begin(), preferedOrder.end(),
-                      knownContentType->contentTypeEnum) == preferedOrder.end())
+        if (std::ranges::find(preferedOrder,
+                              knownContentType->contentTypeEnum) ==
+            preferedOrder.end())
         {
             continue;
         }
diff --git a/include/image_upload.hpp b/include/image_upload.hpp
index 521ff65..2e3e689 100644
--- a/include/image_upload.hpp
+++ b/include/image_upload.hpp
@@ -10,6 +10,7 @@
 #include <cstdio>
 #include <fstream>
 #include <memory>
+#include <ranges>
 
 namespace crow
 {
@@ -66,9 +67,8 @@
         dbus::utility::DBusInteracesMap interfaces;
         m.read(path, interfaces);
 
-        if (std::find_if(interfaces.begin(), interfaces.end(),
-                         [](const auto& i) {
-            return i.first == "xyz.openbmc_project.Software.Version";
+        if (std::ranges::find_if(interfaces, [](const auto& i) {
+                return i.first == "xyz.openbmc_project.Software.Version";
             }) != interfaces.end())
         {
             timeout.cancel();
diff --git a/include/multipart_parser.hpp b/include/multipart_parser.hpp
index 5ac196d..f707abf 100644
--- a/include/multipart_parser.hpp
+++ b/include/multipart_parser.hpp
@@ -4,6 +4,7 @@
 
 #include <boost/beast/http/fields.hpp>
 
+#include <ranges>
 #include <string>
 #include <string_view>
 
@@ -224,7 +225,7 @@
   private:
     void indexBoundary()
     {
-        std::fill(boundaryIndex.begin(), boundaryIndex.end(), 0);
+        std::ranges::fill(boundaryIndex, 0);
         for (const char current : boundary)
         {
             boundaryIndex[static_cast<unsigned char>(current)] = true;
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index 6211fcc..7c47bcc 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -56,6 +56,7 @@
 #include <limits>
 #include <map>
 #include <memory>
+#include <ranges>
 #include <regex>
 #include <string>
 #include <string_view>
@@ -2443,7 +2444,7 @@
             }
             else
             {
-                std::sort(names.begin(), names.end());
+                std::ranges::sort(names);
                 asyncResp->res.jsonValue["status"] = "ok";
                 auto& objectsSub = asyncResp->res.jsonValue["objects"];
                 for (const auto& name : names)
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index 00d77c8..67f1800 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -40,6 +40,7 @@
 #include <ctime>
 #include <fstream>
 #include <memory>
+#include <ranges>
 #include <span>
 
 namespace redfish
@@ -83,10 +84,9 @@
     getMsgFromRegistry(const std::string& messageKey,
                        const std::span<const MessageEntry>& registry)
 {
-    std::span<const MessageEntry>::iterator messageIt =
-        std::find_if(registry.begin(), registry.end(),
-                     [&messageKey](const MessageEntry& messageEntry) {
-        return messageKey == messageEntry.first;
+    std::span<const MessageEntry>::iterator messageIt = std::ranges::find_if(
+        registry, [&messageKey](const MessageEntry& messageEntry) {
+            return messageKey == messageEntry.first;
         });
     if (messageIt != registry.end())
     {
@@ -278,9 +278,8 @@
                        std::vector<std::string>& registryPrefixes,
                        std::vector<std::string>& metricReportDefinitions)
 {
-    sseFilter.erase(std::remove_if(sseFilter.begin(), sseFilter.end(),
-                                   isFilterQuerySpecialChar),
-                    sseFilter.end());
+    auto remove = std::ranges::remove_if(sseFilter, isFilterQuerySpecialChar);
+    sseFilter.erase(std::ranges::begin(remove), sseFilter.end());
 
     std::vector<std::string> result;
 
@@ -447,8 +446,7 @@
             // send everything.
             if (!registryPrefixes.empty())
             {
-                auto obj = std::find(registryPrefixes.begin(),
-                                     registryPrefixes.end(), registryName);
+                auto obj = std::ranges::find(registryPrefixes, registryName);
                 if (obj == registryPrefixes.end())
                 {
                     continue;
@@ -459,8 +457,7 @@
             // send everything.
             if (!registryMsgIds.empty())
             {
-                auto obj = std::find(registryMsgIds.begin(),
-                                     registryMsgIds.end(), messageKey);
+                auto obj = std::ranges::find(registryMsgIds, messageKey);
                 if (obj == registryMsgIds.end())
                 {
                     continue;
@@ -509,9 +506,8 @@
         // Empty list means no filter. Send everything.
         if (!metricReportDefinitions.empty())
         {
-            if (std::find(metricReportDefinitions.begin(),
-                          metricReportDefinitions.end(),
-                          mrdUri.buffer()) == metricReportDefinitions.end())
+            if (std::ranges::find(metricReportDefinitions, mrdUri.buffer()) ==
+                metricReportDefinitions.end())
             {
                 return;
             }
@@ -997,8 +993,8 @@
 
     size_t getNumberOfSSESubscriptions() const
     {
-        auto size = std::count_if(
-            subscriptionsMap.begin(), subscriptionsMap.end(),
+        auto size = std::ranges::count_if(
+            subscriptionsMap,
             [](const std::pair<std::string, std::shared_ptr<Subscription>>&
                    entry) {
             return (entry.second->subscriptionType == subscriptionTypeSSE);
@@ -1369,9 +1365,8 @@
         std::vector<std::string> invalidProps;
         msg.read(interface, props, invalidProps);
 
-        auto found =
-            std::find_if(props.begin(), props.end(),
-                         [](const auto& x) { return x.first == "Readings"; });
+        auto found = std::ranges::find_if(
+            props, [](const auto& x) { return x.first == "Readings"; });
         if (found == props.end())
         {
             BMCWEB_LOG_INFO("Failed to get Readings from Report properties");
diff --git a/redfish-core/include/redfish_aggregator.hpp b/redfish-core/include/redfish_aggregator.hpp
index 0cdf081..2514fae 100644
--- a/redfish-core/include/redfish_aggregator.hpp
+++ b/redfish-core/include/redfish_aggregator.hpp
@@ -9,6 +9,8 @@
 #include <boost/algorithm/string/predicate.hpp>
 
 #include <array>
+#include <ranges>
+#include <string_view>
 
 namespace redfish
 {
@@ -100,9 +102,8 @@
         return (searchType == SearchType::ContainsSubordinate) ||
                (searchType == SearchType::CollOrCon);
     }
-
-    const auto* it = std::lower_bound(
-        topCollections.begin(), topCollections.end(), parsedUrl->buffer());
+    std::string_view url = parsedUrl->buffer();
+    const auto* it = std::ranges::lower_bound(topCollections, url);
     if (it == topCollections.end())
     {
         // parsedUrl is alphabetically after the last entry in the array so it
diff --git a/redfish-core/include/utils/collection.hpp b/redfish-core/include/utils/collection.hpp
index 862be90..0801cd5 100644
--- a/redfish-core/include/utils/collection.hpp
+++ b/redfish-core/include/utils/collection.hpp
@@ -9,6 +9,7 @@
 #include <boost/url/url.hpp>
 #include <nlohmann/json.hpp>
 
+#include <ranges>
 #include <span>
 #include <string>
 #include <string_view>
@@ -68,8 +69,7 @@
             }
             pathNames.push_back(leaf);
         }
-        std::sort(pathNames.begin(), pathNames.end(),
-                  AlphanumLess<std::string>());
+        std::ranges::sort(pathNames, AlphanumLess<std::string>());
 
         nlohmann::json& members = asyncResp->res.jsonValue["Members"];
         members = nlohmann::json::array();
diff --git a/redfish-core/include/utils/json_utils.hpp b/redfish-core/include/utils/json_utils.hpp
index 5b4ad9a..f4e5385 100644
--- a/redfish-core/include/utils/json_utils.hpp
+++ b/redfish-core/include/utils/json_utils.hpp
@@ -32,6 +32,7 @@
 #include <limits>
 #include <map>
 #include <optional>
+#include <ranges>
 #include <span>
 #include <string>
 #include <string_view>
@@ -670,7 +671,7 @@
 // those whose |element[key]| is string.
 inline void sortJsonArrayByOData(nlohmann::json::array_t& array)
 {
-    std::sort(array.begin(), array.end(), ODataObjectLess());
+    std::ranges::sort(array, ODataObjectLess());
 }
 
 // Returns the estimated size of the JSON value
diff --git a/redfish-core/include/utils/query_param.hpp b/redfish-core/include/utils/query_param.hpp
index 696e323..5fa4852 100644
--- a/redfish-core/include/utils/query_param.hpp
+++ b/redfish-core/include/utils/query_param.hpp
@@ -30,6 +30,7 @@
 #include <map>
 #include <memory>
 #include <optional>
+#include <ranges>
 #include <string>
 #include <string_view>
 #include <system_error>
@@ -960,9 +961,8 @@
             constexpr std::array<std::string_view, 5> reservedProperties = {
                 "@odata.id", "@odata.type", "@odata.context", "@odata.etag",
                 "error"};
-            bool reserved = std::find(reservedProperties.begin(),
-                                      reservedProperties.end(),
-                                      it.key()) != reservedProperties.end();
+            bool reserved = std::ranges::find(reservedProperties, it.key()) !=
+                            reservedProperties.end();
             if (reserved || (nextNode != nullptr && nextNode->isSelected()))
             {
                 it = nextIt;
diff --git a/redfish-core/include/utils/sw_utils.hpp b/redfish-core/include/utils/sw_utils.hpp
index cffc637..4e1e066 100644
--- a/redfish-core/include/utils/sw_utils.hpp
+++ b/redfish-core/include/utils/sw_utils.hpp
@@ -13,6 +13,7 @@
 
 #include <algorithm>
 #include <array>
+#include <ranges>
 #include <string>
 #include <string_view>
 #include <vector>
@@ -125,8 +126,8 @@
                 // Look at Ids from
                 // /xyz/openbmc_project/software/functional
                 // to determine if this is a running image
-                if (std::find(functionalSwIds.begin(), functionalSwIds.end(),
-                              swId) != functionalSwIds.end())
+                if (std::ranges::find(functionalSwIds, swId) !=
+                    functionalSwIds.end())
                 {
                     runningImage = true;
                 }
@@ -367,8 +368,7 @@
         }
         std::string reqSwObjPath = "/xyz/openbmc_project/software/" + *swId;
 
-        if (std::find(objPaths.begin(), objPaths.end(), reqSwObjPath) !=
-            objPaths.end())
+        if (std::ranges::find(objPaths, reqSwObjPath) != objPaths.end())
         {
             asyncResp->res.jsonValue["Updateable"] = true;
             return;
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp
index c89073b..4fbf3c3 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -31,6 +31,7 @@
 
 #include <array>
 #include <optional>
+#include <ranges>
 #include <string>
 #include <string_view>
 #include <vector>
@@ -2007,12 +2008,11 @@
             messages::internalError(asyncResp->res);
             return;
         }
-        const auto userIt = std::find_if(
-            users.begin(), users.end(),
-            [accountName](
-                const std::pair<sdbusplus::message::object_path,
-                                dbus::utility::DBusInteracesMap>& user) {
-            return accountName == user.first.filename();
+        const auto userIt = std::ranges::find_if(
+            users, [accountName](
+                       const std::pair<sdbusplus::message::object_path,
+                                       dbus::utility::DBusInteracesMap>& user) {
+                return accountName == user.first.filename();
             });
 
         if (userIt == users.end())
diff --git a/redfish-core/lib/chassis.hpp b/redfish-core/lib/chassis.hpp
index 397e31c..969973f 100644
--- a/redfish-core/lib/chassis.hpp
+++ b/redfish-core/lib/chassis.hpp
@@ -34,6 +34,7 @@
 #include <sdbusplus/unpack_properties.hpp>
 
 #include <array>
+#include <ranges>
 #include <string_view>
 
 namespace redfish
@@ -514,8 +515,8 @@
 
             for (const char* interface : hasIndicatorLed)
             {
-                if (std::find(interfaces2.begin(), interfaces2.end(),
-                              interface) != interfaces2.end())
+                if (std::ranges::find(interfaces2, interface) !=
+                    interfaces2.end())
                 {
                     getIndicatorLedState(asyncResp);
                     getLocationIndicatorActive(asyncResp);
@@ -728,8 +729,8 @@
             bool indicatorChassis = false;
             for (const char* interface : hasIndicatorLed)
             {
-                if (std::find(interfaces3.begin(), interfaces3.end(),
-                              interface) != interfaces3.end())
+                if (std::ranges::find(interfaces3, interface) !=
+                    interfaces3.end())
                 {
                     indicatorChassis = true;
                     break;
@@ -840,8 +841,7 @@
         std::string objectPath = "/xyz/openbmc_project/state/chassis_system0";
 
         /* Look for system reset chassis path */
-        if ((std::find(chassisList.begin(), chassisList.end(), objectPath)) ==
-            chassisList.end())
+        if ((std::ranges::find(chassisList, objectPath)) == chassisList.end())
         {
             /* We prefer to reset the full chassis_system, but if it doesn't
              * exist on some platforms, fall back to a host-only power reset
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 57fe24c..50287b0 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -34,6 +34,7 @@
 
 #include <array>
 #include <optional>
+#include <ranges>
 #include <regex>
 #include <string_view>
 #include <vector>
@@ -446,9 +447,8 @@
             {
                 if (interface.first == "xyz.openbmc_project.Network.IP")
                 {
-                    auto type = std::find_if(interface.second.begin(),
-                                             interface.second.end(),
-                                             [](const auto& property) {
+                    auto type = std::ranges::find_if(interface.second,
+                                                     [](const auto& property) {
                         return property.first == "Type";
                     });
                     if (type == interface.second.end())
@@ -539,9 +539,8 @@
             {
                 if (interface.first == "xyz.openbmc_project.Network.IP")
                 {
-                    auto type = std::find_if(interface.second.begin(),
-                                             interface.second.end(),
-                                             [](const auto& property) {
+                    auto type = std::ranges::find_if(interface.second,
+                                                     [](const auto& property) {
                         return property.first == "Type";
                     });
                     if (type == interface.second.end())
@@ -886,8 +885,7 @@
             }
         }
 
-        std::sort(ifaceList.begin(), ifaceList.end(),
-                  AlphanumLess<std::string>());
+        std::ranges::sort(ifaceList, AlphanumLess<std::string>());
 
         // Finally make a callback with useful data
         callback(true, ifaceList);
@@ -955,7 +953,7 @@
 inline bool isHostnameValid(const std::string& hostname)
 {
     // A valid host name can never have the dotted-decimal form (RFC 1123)
-    if (std::all_of(hostname.begin(), hostname.end(), ::isdigit))
+    if (std::ranges::all_of(hostname, ::isdigit))
     {
         return false;
     }
diff --git a/redfish-core/lib/event_service.hpp b/redfish-core/lib/event_service.hpp
index 2c2fd5d..b49e35a 100644
--- a/redfish-core/lib/event_service.hpp
+++ b/redfish-core/lib/event_service.hpp
@@ -29,6 +29,7 @@
 
 #include <charconv>
 #include <memory>
+#include <ranges>
 #include <span>
 #include <string>
 
@@ -420,9 +421,8 @@
 
         if (eventFormatType2)
         {
-            if (std::find(supportedEvtFormatTypes.begin(),
-                          supportedEvtFormatTypes.end(),
-                          *eventFormatType2) == supportedEvtFormatTypes.end())
+            if (std::ranges::find(supportedEvtFormatTypes, *eventFormatType2) ==
+                supportedEvtFormatTypes.end())
             {
                 messages::propertyValueNotInList(
                     asyncResp->res, *eventFormatType2, "EventFormatType");
@@ -487,9 +487,8 @@
         {
             for (const std::string& it : *regPrefixes)
             {
-                if (std::find(supportedRegPrefixes.begin(),
-                              supportedRegPrefixes.end(),
-                              it) == supportedRegPrefixes.end())
+                if (std::ranges::find(supportedRegPrefixes, it) ==
+                    supportedRegPrefixes.end())
                 {
                     messages::propertyValueNotInList(asyncResp->res, it,
                                                      "RegistryPrefixes");
@@ -503,9 +502,8 @@
         {
             for (const std::string& it : *resTypes)
             {
-                if (std::find(supportedResourceTypes.begin(),
-                              supportedResourceTypes.end(),
-                              it) == supportedResourceTypes.end())
+                if (std::ranges::find(supportedResourceTypes, it) ==
+                    supportedResourceTypes.end())
                 {
                     messages::propertyValueNotInList(asyncResp->res, it,
                                                      "ResourceTypes");
@@ -542,8 +540,8 @@
                         registry =
                             redfish::registries::getRegistryFromPrefix(it);
 
-                    if (std::any_of(
-                            registry.begin(), registry.end(),
+                    if (std::ranges::any_of(
+                            registry,
                             [&id](const redfish::registries::MessageEntry&
                                       messageEntry) {
                         return id == messageEntry.first;
@@ -567,9 +565,8 @@
 
         if (retryPolicy)
         {
-            if (std::find(supportedRetryPolicies.begin(),
-                          supportedRetryPolicies.end(),
-                          *retryPolicy) == supportedRetryPolicies.end())
+            if (std::ranges::find(supportedRetryPolicies, *retryPolicy) ==
+                supportedRetryPolicies.end())
             {
                 messages::propertyValueNotInList(asyncResp->res, *retryPolicy,
                                                  "DeliveryRetryPolicy");
@@ -732,9 +729,8 @@
 
         if (retryPolicy)
         {
-            if (std::find(supportedRetryPolicies.begin(),
-                          supportedRetryPolicies.end(),
-                          *retryPolicy) == supportedRetryPolicies.end())
+            if (std::ranges::find(supportedRetryPolicies, *retryPolicy) ==
+                supportedRetryPolicies.end())
             {
                 messages::propertyValueNotInList(asyncResp->res, *retryPolicy,
                                                  "DeliveryRetryPolicy");
diff --git a/redfish-core/lib/health.hpp b/redfish-core/lib/health.hpp
index 55f79bc..0c35cb5 100644
--- a/redfish-core/lib/health.hpp
+++ b/redfish-core/lib/health.hpp
@@ -23,6 +23,7 @@
 #include <nlohmann/json.hpp>
 
 #include <array>
+#include <ranges>
 #include <string_view>
 #include <variant>
 
@@ -121,9 +122,8 @@
                             bool containsChild = false;
                             for (const std::string& endpoint : *endpoints)
                             {
-                                if (std::find(inventory.begin(),
-                                              inventory.end(),
-                                              endpoint) != inventory.end())
+                                if (std::ranges::find(inventory, endpoint) !=
+                                    inventory.end())
                                 {
                                     containsChild = true;
                                     break;
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index e17169a..3cf6599 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -50,6 +50,7 @@
 #include <charconv>
 #include <filesystem>
 #include <optional>
+#include <ranges>
 #include <span>
 #include <string_view>
 #include <variant>
@@ -302,7 +303,7 @@
     // As the log files rotate, they are appended with a ".#" that is higher for
     // the older logs. Since we don't expect more than 10 log files, we
     // can just sort the list to get them in order from newest to oldest
-    std::sort(redfishLogFiles.begin(), redfishLogFiles.end());
+    std::ranges::sort(redfishLogFiles);
 
     return !redfishLogFiles.empty();
 }
@@ -492,14 +493,13 @@
         asyncResp->res.jsonValue["Description"] = "Collection of " + dumpType +
                                                   " Dump Entries";
 
-        nlohmann::json& entriesArray = asyncResp->res.jsonValue["Members"];
-        entriesArray = nlohmann::json::array();
+        nlohmann::json::array_t entriesArray;
         std::string dumpEntryPath =
             "/xyz/openbmc_project/dump/" +
             std::string(boost::algorithm::to_lower_copy(dumpType)) + "/entry/";
 
         dbus::utility::ManagedObjectType resp(objects);
-        std::sort(resp.begin(), resp.end(), [](const auto& l, const auto& r) {
+        std::ranges::sort(resp, [](const auto& l, const auto& r) {
             return AlphanumLess<std::string>()(l.first.filename(),
                                                r.first.filename());
         });
@@ -568,6 +568,7 @@
             entriesArray.emplace_back(std::move(thisEntry));
         }
         asyncResp->res.jsonValue["Members@odata.count"] = entriesArray.size();
+        asyncResp->res.jsonValue["Members"] = std::move(entriesArray);
         });
 }
 
@@ -1588,8 +1589,7 @@
                 messages::internalError(asyncResp->res);
                 return;
             }
-            nlohmann::json& entriesArray = asyncResp->res.jsonValue["Members"];
-            entriesArray = nlohmann::json::array();
+            nlohmann::json::array_t entriesArray;
             for (const auto& objectPath : resp)
             {
                 const uint32_t* id = nullptr;
@@ -1690,8 +1690,7 @@
                 {
                     continue;
                 }
-                entriesArray.push_back({});
-                nlohmann::json& thisEntry = entriesArray.back();
+                nlohmann::json& thisEntry = entriesArray.emplace_back();
                 thisEntry["@odata.type"] = "#LogEntry.v1_9_0.LogEntry";
                 thisEntry["@odata.id"] = boost::urls::format(
                     "/redfish/v1/Systems/system/LogServices/EventLog/Entries/{}",
@@ -1724,13 +1723,13 @@
                         std::to_string(*id) + "/attachment";
                 }
             }
-            std::sort(
-                entriesArray.begin(), entriesArray.end(),
-                [](const nlohmann::json& left, const nlohmann::json& right) {
+            std::ranges::sort(entriesArray, [](const nlohmann::json& left,
+                                               const nlohmann::json& right) {
                 return (left["Id"] <= right["Id"]);
-                });
+            });
             asyncResp->res.jsonValue["Members@odata.count"] =
                 entriesArray.size();
+            asyncResp->res.jsonValue["Members"] = std::move(entriesArray);
             });
         });
 }
diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp
index c51a586..32385de 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -38,6 +38,7 @@
 #include <array>
 #include <cstdint>
 #include <memory>
+#include <ranges>
 #include <sstream>
 #include <string_view>
 #include <variant>
@@ -741,8 +742,7 @@
     std::string escaped = value;
     std::replace(escaped.begin(), escaped.end(), ' ', '_');
     escaped = "/" + escaped;
-    auto it = std::find_if(managedObj.begin(), managedObj.end(),
-                           [&escaped](const auto& obj) {
+    auto it = std::ranges::find_if(managedObj, [&escaped](const auto& obj) {
         if (boost::algorithm::ends_with(obj.first.str, escaped))
         {
             BMCWEB_LOG_DEBUG("Matched {}", obj.first.str);
@@ -1118,8 +1118,8 @@
         {
             constexpr const std::array<const char*, 2> allowedDirections = {
                 "Ceiling", "Floor"};
-            if (std::find(allowedDirections.begin(), allowedDirections.end(),
-                          *direction) == allowedDirections.end())
+            if (std::ranges::find(allowedDirections, *direction) ==
+                allowedDirections.end())
             {
                 messages::propertyValueTypeError(response->res, "Direction",
                                                  *direction);
@@ -1372,8 +1372,8 @@
             {
                 for (const auto& [interface, _] : object)
                 {
-                    if (std::find(configurations.begin(), configurations.end(),
-                                  interface) != configurations.end())
+                    if (std::ranges::find(configurations, interface) !=
+                        configurations.end())
                     {
                         self->objectCount++;
                         break;
@@ -1451,8 +1451,8 @@
         std::shared_ptr<bmcweb::AsyncResp> response = asyncResp;
         if (profile)
         {
-            if (std::find(supportedProfiles.begin(), supportedProfiles.end(),
-                          *profile) == supportedProfiles.end())
+            if (std::ranges::find(supportedProfiles, *profile) ==
+                supportedProfiles.end())
             {
                 messages::actionParameterUnknown(response->res, "Profile",
                                                  *profile);
@@ -1490,12 +1490,11 @@
                 std::replace(dbusObjName.begin(), dbusObjName.end(), ' ', '_');
                 BMCWEB_LOG_DEBUG("looking for {}", name);
 
-                auto pathItr = std::find_if(managedObj.begin(),
-                                            managedObj.end(),
-                                            [&dbusObjName](const auto& obj) {
-                    return boost::algorithm::ends_with(obj.first.str,
-                                                       "/" + dbusObjName);
-                });
+                auto pathItr = std::ranges::find_if(
+                    managedObj, [&dbusObjName](const auto& obj) {
+                        return boost::algorithm::ends_with(obj.first.str,
+                                                           "/" + dbusObjName);
+                    });
                 dbus::utility::DBusPropertiesMap output;
 
                 output.reserve(16); // The pid interface length
diff --git a/redfish-core/lib/processor.hpp b/redfish-core/lib/processor.hpp
index 873f882..e09a125 100644
--- a/redfish-core/lib/processor.hpp
+++ b/redfish-core/lib/processor.hpp
@@ -37,6 +37,7 @@
 
 #include <array>
 #include <limits>
+#include <ranges>
 #include <string_view>
 
 namespace redfish
@@ -814,10 +815,9 @@
             // (e.g. /redfish/../Processors/dimm0)
             for (const auto& [serviceName, interfaceList] : serviceMap)
             {
-                if (std::find_first_of(
-                        interfaceList.begin(), interfaceList.end(),
-                        processorInterfaces.begin(),
-                        processorInterfaces.end()) != interfaceList.end())
+                if (std::ranges::find_first_of(interfaceList,
+                                               processorInterfaces) !=
+                    std::end(interfaceList))
                 {
                     found = true;
                     break;
@@ -1083,9 +1083,9 @@
     const std::string* controlService = nullptr;
     for (const auto& [serviceName, interfaceList] : serviceMap)
     {
-        if (std::find(interfaceList.begin(), interfaceList.end(),
-                      "xyz.openbmc_project.Control.Processor."
-                      "CurrentOperatingConfig") != interfaceList.end())
+        if (std::ranges::find(interfaceList,
+                              "xyz.openbmc_project.Control.Processor."
+                              "CurrentOperatingConfig") != interfaceList.end())
         {
             controlService = &serviceName;
             break;
diff --git a/redfish-core/lib/redfish_util.hpp b/redfish-core/lib/redfish_util.hpp
index fad410d..4806cb4 100644
--- a/redfish-core/lib/redfish_util.hpp
+++ b/redfish-core/lib/redfish_util.hpp
@@ -25,6 +25,7 @@
 
 #include <array>
 #include <charconv>
+#include <ranges>
 #include <string_view>
 
 namespace redfish
@@ -166,8 +167,8 @@
                 // Some protocols may have multiple services associated with
                 // them (for example IPMI). Look to see if we've already added
                 // an entry for the current protocol.
-                auto find = std::find_if(
-                    socketData.begin(), socketData.end(),
+                auto find = std::ranges::find_if(
+                    socketData,
                     [&kv](const std::tuple<std::string, std::string, bool>& i) {
                     return std::get<1>(i) == kv.first;
                     });
diff --git a/redfish-core/lib/redfish_v1.hpp b/redfish-core/lib/redfish_v1.hpp
index a591763..bbda45b 100644
--- a/redfish-core/lib/redfish_v1.hpp
+++ b/redfish-core/lib/redfish_v1.hpp
@@ -11,6 +11,7 @@
 
 #include <boost/url/format.hpp>
 
+#include <ranges>
 #include <string>
 
 namespace redfish
@@ -105,7 +106,7 @@
         return;
     }
 
-    if (std::find(schemas.begin(), schemas.end(), schema) == schemas.end())
+    if (std::ranges::find(schemas, schema) == schemas.end())
     {
         messages::resourceNotFound(asyncResp->res, "JsonSchemaFile", schema);
         return;
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index 2f94d3a..76a8bdd 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -41,6 +41,7 @@
 #include <iterator>
 #include <limits>
 #include <map>
+#include <ranges>
 #include <set>
 #include <string_view>
 #include <utility>
@@ -733,9 +734,8 @@
     if (chassisSubNode == sensors::node::sensors)
     {
         std::string subNodeEscaped(sensorType);
-        subNodeEscaped.erase(
-            std::remove(subNodeEscaped.begin(), subNodeEscaped.end(), '_'),
-            subNodeEscaped.end());
+        auto remove = std::ranges::remove(subNodeEscaped, '_');
+        subNodeEscaped.erase(std::ranges::begin(remove), subNodeEscaped.end());
 
         // For sensors in SensorCollection we set Id instead of MemberId,
         // including power sensors.
@@ -1017,11 +1017,10 @@
                     return; // if they don't have an association we
                             // can't tell what chassis is
                 }
-                auto found =
-                    std::find_if(endpoints.begin(), endpoints.end(),
-                                 [sensorsAsyncResp](const std::string& entry) {
-                    return entry.find(sensorsAsyncResp->chassisId) !=
-                           std::string::npos;
+                auto found = std::ranges::find_if(
+                    endpoints, [sensorsAsyncResp](const std::string& entry) {
+                        return entry.find(sensorsAsyncResp->chassisId) !=
+                               std::string::npos;
                     });
 
                 if (found == endpoints.end())
@@ -1105,10 +1104,9 @@
                         todo(ed): merge patch that fixes the names
                         std::replace(itemName.begin(),
                                      itemName.end(), '_', ' ');*/
-                        auto schemaItem =
-                            std::find_if(fanRedfish.begin(), fanRedfish.end(),
-                                         [itemName](const nlohmann::json& fan) {
-                            return fan["Name"] == itemName;
+                        auto schemaItem = std::ranges::find_if(
+                            fanRedfish, [itemName](const nlohmann::json& fan) {
+                                return fan["Name"] == itemName;
                             });
                         if (schemaItem != fanRedfish.end())
                         {
@@ -2319,10 +2317,10 @@
                     !sensorsAsyncResp->efficientExpand)
                 {
                     std::string sensorTypeEscaped(sensorType);
-                    sensorTypeEscaped.erase(
-                        std::remove(sensorTypeEscaped.begin(),
-                                    sensorTypeEscaped.end(), '_'),
-                        sensorTypeEscaped.end());
+                    auto remove = std::ranges::remove(sensorTypeEscaped, '_');
+
+                    sensorTypeEscaped.erase(std::ranges::begin(remove),
+                                            sensorTypeEscaped.end());
                     std::string sensorId(sensorTypeEscaped);
                     sensorId += "_";
                     sensorId += sensorName;
@@ -2411,10 +2409,10 @@
                     else if (fieldName == "Members")
                     {
                         std::string sensorTypeEscaped(sensorType);
-                        sensorTypeEscaped.erase(
-                            std::remove(sensorTypeEscaped.begin(),
-                                        sensorTypeEscaped.end(), '_'),
-                            sensorTypeEscaped.end());
+                        auto remove = std::ranges::remove(sensorTypeEscaped,
+                                                          '_');
+                        sensorTypeEscaped.erase(std::ranges::begin(remove),
+                                                sensorTypeEscaped.end());
                         std::string sensorId(sensorTypeEscaped);
                         sensorId += "_";
                         sensorId += sensorName;
@@ -2683,7 +2681,8 @@
                     return;
                 }
                 std::string id = path.parent_path().filename();
-                id.erase(std::remove(id.begin(), id.end(), '_'), id.end());
+                auto remove = std::ranges::remove(id, '_');
+                id.erase(std::ranges::begin(remove), id.end());
                 id += "_";
                 id += sensorName;
 
@@ -2795,7 +2794,8 @@
         std::string type = path.parent_path().filename();
         // fan_tach has an underscore in it, so remove it to "normalize" the
         // type in the URI
-        type.erase(std::remove(type.begin(), type.end(), '_'), type.end());
+        auto remove = std::ranges::remove(type, '_');
+        type.erase(std::ranges::begin(remove), type.end());
 
         nlohmann::json::object_t member;
         std::string id = type;
diff --git a/redfish-core/lib/storage.hpp b/redfish-core/lib/storage.hpp
index 1f41ea8..389a20b 100644
--- a/redfish-core/lib/storage.hpp
+++ b/redfish-core/lib/storage.hpp
@@ -36,6 +36,7 @@
 #include <sdbusplus/unpack_properties.hpp>
 
 #include <array>
+#include <ranges>
 #include <string_view>
 
 namespace redfish
@@ -166,8 +167,8 @@
                                    storageId);
         return;
     }
-    auto storage = std::find_if(
-        subtree.begin(), subtree.end(),
+    auto storage = std::ranges::find_if(
+        subtree,
         [&storageId](const std::pair<std::string,
                                      dbus::utility::MapperServiceMap>& object) {
         return sdbusplus::message::object_path(object.first).filename() ==
@@ -235,8 +236,8 @@
                                    storageId);
         return;
     }
-    auto storage = std::find_if(
-        subtree.begin(), subtree.end(),
+    auto storage = std::ranges::find_if(
+        subtree,
         [&storageId](const std::pair<std::string,
                                      dbus::utility::MapperServiceMap>& object) {
         return sdbusplus::message::object_path(object.first).filename() ==
@@ -651,8 +652,8 @@
         return;
     }
 
-    auto drive = std::find_if(
-        subtree.begin(), subtree.end(),
+    auto drive = std::ranges::find_if(
+        subtree,
         [&driveId](const std::pair<std::string,
                                    dbus::utility::MapperServiceMap>& object) {
         return sdbusplus::message::object_path(object.first).filename() ==
@@ -800,8 +801,7 @@
                 leafNames.push_back(drivePath.filename());
             }
 
-            std::sort(leafNames.begin(), leafNames.end(),
-                      AlphanumLess<std::string>());
+            std::ranges::sort(leafNames, AlphanumLess<std::string>());
 
             for (const auto& leafName : leafNames)
             {
diff --git a/redfish-core/lib/task.hpp b/redfish-core/lib/task.hpp
index 8a5c30b..40e1a51 100644
--- a/redfish-core/lib/task.hpp
+++ b/redfish-core/lib/task.hpp
@@ -32,6 +32,7 @@
 
 #include <chrono>
 #include <memory>
+#include <ranges>
 #include <variant>
 
 namespace redfish
@@ -67,8 +68,8 @@
 
         for (const auto& field : req.fields())
         {
-            if (std::find(headerWhitelist.begin(), headerWhitelist.end(),
-                          field.name()) == headerWhitelist.end())
+            if (std::ranges::find(headerWhitelist, field.name()) ==
+                headerWhitelist.end())
             {
                 continue;
             }
@@ -336,8 +337,8 @@
         {
             return;
         }
-        auto find = std::find_if(
-            task::tasks.begin(), task::tasks.end(),
+        auto find = std::ranges::find_if(
+            task::tasks,
             [&strParam](const std::shared_ptr<task::TaskData>& task) {
             if (!task)
             {
@@ -377,8 +378,8 @@
         {
             return;
         }
-        auto find = std::find_if(
-            task::tasks.begin(), task::tasks.end(),
+        auto find = std::ranges::find_if(
+            task::tasks,
             [&strParam](const std::shared_ptr<task::TaskData>& task) {
             if (!task)
             {
diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp
index 9ef45e7..195bc07 100644
--- a/redfish-core/lib/virtual_media.hpp
+++ b/redfish-core/lib/virtual_media.hpp
@@ -29,6 +29,7 @@
 #include <boost/url/url_view.hpp>
 
 #include <array>
+#include <ranges>
 #include <string_view>
 
 namespace redfish
@@ -608,9 +609,9 @@
         // Pack secret
         auto secret = credentials.pack(
             [](const auto& user, const auto& pass, auto& buff) {
-            std::copy(user.begin(), user.end(), std::back_inserter(buff));
+            std::ranges::copy(user, std::back_inserter(buff));
             buff.push_back('\0');
-            std::copy(pass.begin(), pass.end(), std::back_inserter(buff));
+            std::ranges::copy(pass, std::back_inserter(buff));
             buff.push_back('\0');
         });
 
diff --git a/redfish-core/src/registries.cpp b/redfish-core/src/registries.cpp
index 3bfe059..e465b15 100644
--- a/redfish-core/src/registries.cpp
+++ b/redfish-core/src/registries.cpp
@@ -4,6 +4,7 @@
 #include "registries/openbmc_message_registry.hpp"
 #include "str_utility.hpp"
 
+#include <ranges>
 #include <string>
 #include <vector>
 
@@ -13,10 +14,9 @@
 const Message* getMessageFromRegistry(const std::string& messageKey,
                                       std::span<const MessageEntry> registry)
 {
-    std::span<const MessageEntry>::iterator messageIt =
-        std::find_if(registry.begin(), registry.end(),
-                     [&messageKey](const MessageEntry& messageEntry) {
-        return std::strcmp(messageEntry.first, messageKey.c_str()) == 0;
+    std::span<const MessageEntry>::iterator messageIt = std::ranges::find_if(
+        registry, [&messageKey](const MessageEntry& messageEntry) {
+            return std::strcmp(messageEntry.first, messageKey.c_str()) == 0;
         });
     if (messageIt != registry.end())
     {
