diff --git a/occ_command.cpp b/occ_command.cpp
index 2ebacb0..e2ec8a7 100644
--- a/occ_command.cpp
+++ b/occ_command.cpp
@@ -4,7 +4,6 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <fmt/core.h>
 #include <unistd.h>
 
 #include <org/open_power/OCC/Device/error.hpp>
@@ -13,6 +12,7 @@
 #include <phosphor-logging/log.hpp>
 
 #include <algorithm>
+#include <format>
 #include <memory>
 #include <string>
 
@@ -39,14 +39,14 @@
     {
         if (i % 16 == 0)
         {
-            s += fmt::format("{:04X}: ", i);
+            s += std::format("{:04X}: ", i);
         }
         else if (i % 4 == 0)
         {
             s += " ";
         }
 
-        s += fmt::format("{:02X}", data.at(i));
+        s += std::format("{:02X}", data.at(i));
 
         if ((i % 16 == 15) || (i == (dump_length - 1)))
         {
@@ -66,7 +66,7 @@
                   std::placeholders::_1))
 {
     log<level::DEBUG>(
-        fmt::format("OccCommand::OccCommand(path={}, devicePath={}", this->path,
+        std::format("OccCommand::OccCommand(path={}, devicePath={}", this->path,
                     devicePath)
             .c_str());
 }
@@ -76,14 +76,14 @@
     using namespace sdbusplus::org::open_power::OCC::Device::Error;
 
     log<level::DEBUG>(
-        fmt::format("OccCommand::openDevice: calling open {}", devicePath)
+        std::format("OccCommand::openDevice: calling open {}", devicePath)
             .c_str());
     fd = open(devicePath.c_str(), O_RDWR | O_NONBLOCK);
     if (fd < 0)
     {
         const int openErrno = errno;
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "OccCommand::openDevice: open failed (errno={}, path={})",
                 openErrno, devicePath)
                 .c_str());
@@ -126,7 +126,7 @@
     const uint8_t cmd_type = command[0];
 #ifdef TRACE_PACKETS
     log<level::INFO>(
-        fmt::format("OCC{}: Sending 0x{:02X} command (length={}, {})",
+        std::format("OCC{}: Sending 0x{:02X} command (length={}, {})",
                     occInstance, cmd_type, command.size(), devicePath)
             .c_str());
     dump_hex(command);
@@ -142,7 +142,7 @@
         if ((rc < 0) || (rc != (int)command.size()))
         {
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "OccCommand::send: write(OCC{}, command:0x{:02X}) failed with errno={} (retries={})",
                     occInstance, cmd_type, writeErrno, retries)
                     .c_str());
@@ -181,7 +181,7 @@
             else
             {
                 log<level::ERR>(
-                    fmt::format(
+                    std::format(
                         "OccCommand::send: read(OCC{}, command:0x{:02X}) failed with errno={} (rspSize={}, retries={})",
                         occInstance, cmd_type, readErrno, response.size(),
                         retries)
@@ -200,7 +200,7 @@
         {
 #ifdef TRACE_PACKETS
             log<level::INFO>(
-                fmt::format(
+                std::format(
                     "OCC{}: Received 0x{:02X} response (length={} w/checksum)",
                     occInstance, cmd_type, response.size())
                     .c_str());
@@ -223,7 +223,7 @@
             if (calcChecksum != rspChecksum)
             {
                 log<level::ERR>(
-                    fmt::format("OCC{}: Checksum Mismatch: response "
+                    std::format("OCC{}: Checksum Mismatch: response "
                                 "0x{:04X}, calculated 0x{:04X}",
                                 occInstance, rspChecksum, calcChecksum)
                         .c_str());
@@ -245,7 +245,7 @@
                 else
                 {
                     log<level::ERR>(
-                        fmt::format(
+                        std::format(
                             "OccCommand::send: Response command mismatch "
                             "(sent: "
                             "0x{:02X}, rsp: 0x{:02X}, rsp seq#: 0x{:02X}",
@@ -258,7 +258,7 @@
         else
         {
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "OccCommand::send: Invalid OCC{} response length: {}",
                     occInstance, response.size())
                     .c_str());
diff --git a/occ_command.hpp b/occ_command.hpp
index a8c5dd4..58d351a 100644
--- a/occ_command.hpp
+++ b/occ_command.hpp
@@ -3,13 +3,13 @@
 #include "occ_errors.hpp"
 #include "utils.hpp"
 
-#include <fmt/format.h>
-
 #include <org/open_power/OCC/PassThrough/server.hpp>
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/server/object.hpp>
 
+#include <format>
 #include <string>
+#include <utility>
 
 namespace open_power
 {
@@ -62,7 +62,7 @@
 
 static inline auto format_as(SysPwrMode spm)
 {
-    return fmt::underlying(spm);
+    return std::to_underlying(spm);
 }
 
 // Only some of the SysPwrModes are currently supported and allowed to be set
@@ -98,7 +98,7 @@
 
 static inline auto format_as(CmdStatus cs)
 {
-    return fmt::underlying(cs);
+    return std::to_underlying(cs);
 }
 
 /** @brief Trace block of data in hex with log<level:INFO>
diff --git a/occ_dbus.cpp b/occ_dbus.cpp
index 811f1ab..fb2ff27 100644
--- a/occ_dbus.cpp
+++ b/occ_dbus.cpp
@@ -2,10 +2,9 @@
 
 #include "utils.hpp"
 
-#include <fmt/core.h>
-
 #include <phosphor-logging/log.hpp>
 
+#include <format>
 #include <iostream>
 
 namespace open_power
@@ -215,7 +214,7 @@
                  paths.end())
         {
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "Could not find a chassis out of {} chassis objects",
                     paths.size())
                     .c_str());
@@ -227,7 +226,7 @@
     catch (const std::exception& e)
     {
         log<level::ERR>(
-            fmt::format("Error looking up chassis objects: {}", e.what())
+            std::format("Error looking up chassis objects: {}", e.what())
                 .c_str());
         abort();
     }
diff --git a/occ_device.cpp b/occ_device.cpp
index c83b1ff..ded5db9 100644
--- a/occ_device.cpp
+++ b/occ_device.cpp
@@ -25,7 +25,7 @@
     }
     catch (const std::exception& e)
     {
-        log<level::ERR>(fmt::format("Failed to set {} active: {}",
+        log<level::ERR>(std::format("Failed to set {} active: {}",
                                     devPath.c_str(), e.what())
                             .c_str());
     }
@@ -152,7 +152,7 @@
     catch (const fs::filesystem_error& e)
     {
         log<level::ERR>(
-            fmt::format("getFilenameByRegex: Failed to get filename: {}",
+            std::format("getFilenameByRegex: Failed to get filename: {}",
                         e.what())
                 .c_str());
     }
diff --git a/occ_errors.cpp b/occ_errors.cpp
index 63c1881..5c9c48f 100644
--- a/occ_errors.cpp
+++ b/occ_errors.cpp
@@ -2,7 +2,6 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <fmt/core.h>
 #include <sys/ioctl.h>
 #include <unistd.h>
 
@@ -11,6 +10,8 @@
 #include <phosphor-logging/elog.hpp>
 #include <phosphor-logging/log.hpp>
 #include <xyz/openbmc_project/Common/error.hpp>
+
+#include <format>
 namespace open_power
 {
 namespace occ
@@ -31,7 +32,7 @@
     if (fd < 0)
     {
         log<level::ERR>(
-            fmt::format("Error::openFile: open failed (errno={})", open_errno)
+            std::format("Error::openFile: open failed (errno={})", open_errno)
                 .c_str());
         elog<OpenFailure>(phosphor::logging::org::open_power::OCC::Device::
                               OpenFailure::CALLOUT_ERRNO(open_errno),
diff --git a/occ_ffdc.cpp b/occ_ffdc.cpp
index 973a554..131913b 100644
--- a/occ_ffdc.cpp
+++ b/occ_ffdc.cpp
@@ -4,7 +4,6 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <fmt/core.h>
 #include <stdio.h>
 #include <sys/ioctl.h>
 #include <unistd.h>
@@ -17,6 +16,8 @@
 #include <xyz/openbmc_project/Common/error.hpp>
 #include <xyz/openbmc_project/Logging/Create/server.hpp>
 
+#include <format>
+
 namespace open_power
 {
 namespace occ
@@ -43,7 +44,7 @@
         pelFFDCInfo;
 
     log<level::INFO>(
-        fmt::format("Creating PEL for OCC{} with SBE FFDC: {} - SRC6: 0x{:08X}",
+        std::format("Creating PEL for OCC{} with SBE FFDC: {} - SRC6: 0x{:08X}",
                     src6 >> 16, path, src6)
             .c_str());
 
@@ -92,7 +93,7 @@
     catch (const sdbusplus::exception_t& e)
     {
         log<level::ERR>(
-            fmt::format("Failed to create PEL: {}", e.what()).c_str());
+            std::format("Failed to create PEL: {}", e.what()).c_str());
     }
 
     return plid;
@@ -118,7 +119,7 @@
     additionalData.emplace("OCC", std::to_string(instance));
 
     log<level::INFO>(
-        fmt::format("Creating OCC Reset PEL for OCC{}: {}", instance, path)
+        std::format("Creating OCC Reset PEL for OCC{}: {}", instance, path)
             .c_str());
 
     auto& bus = utils::getBus();
@@ -150,7 +151,7 @@
     catch (const sdbusplus::exception_t& e)
     {
         log<level::ERR>(
-            fmt::format("Failed to create OCC Reset PEL: {}", e.what())
+            std::format("Failed to create OCC Reset PEL: {}", e.what())
                 .c_str());
     }
 }
@@ -239,7 +240,7 @@
     if (journalFile && journalFile->fd() != -1)
     {
         log<level::DEBUG>(
-            fmt::format(
+            std::format(
                 "addJournalEntries: Added up to {} journal entries for {}",
                 lines, executable)
                 .c_str());
@@ -248,7 +249,7 @@
     else
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "addJournalEntries: Failed to add journal entries for {}",
                 executable)
                 .c_str());
@@ -275,7 +276,7 @@
         {
             auto e = errno;
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "makeJsonFFDCFile: Failed call to write JSON FFDC file, errno={}",
                     e)
                     .c_str());
@@ -285,7 +286,7 @@
     {
         auto e = errno;
         log<level::ERR>(
-            fmt::format("makeJsonFFDCFile: Failed called to mkostemp, errno={}",
+            std::format("makeJsonFFDCFile: Failed called to mkostemp, errno={}",
                         e)
                 .c_str());
     }
@@ -429,7 +430,7 @@
     {
         auto e = errno;
         log<level::ERR>(
-            fmt::format("FFDCFile: Could not open FFDC file {}. errno {}",
+            std::format("FFDCFile: Could not open FFDC file {}. errno {}",
                         _name.string(), e)
                 .c_str());
     }
diff --git a/occ_manager.cpp b/occ_manager.cpp
index 70adeca..fa93dad 100644
--- a/occ_manager.cpp
+++ b/occ_manager.cpp
@@ -89,7 +89,7 @@
                 prevOCCSearch = occs;
 
                 log<level::INFO>(
-                    fmt::format(
+                    std::format(
                         "Manager::findAndCreateObjects(): Waiting for OCCs (currently {})",
                         occs.size())
                         .c_str());
@@ -104,7 +104,7 @@
                 std::sort(occs.begin(), occs.end());
 
                 log<level::INFO>(
-                    fmt::format(
+                    std::format(
                         "Manager::findAndCreateObjects(): Creating {} OCC Status Objects",
                         occs.size())
                         .c_str());
@@ -151,7 +151,7 @@
     else
     {
         log<level::INFO>(
-            fmt::format(
+            std::format(
                 "Manager::findAndCreateObjects(): Waiting for {} to complete...",
                 HOST_ON_FILE)
                 .c_str());
@@ -189,7 +189,7 @@
                 {
                     queuedActiveState.erase(match);
                     log<level::INFO>(
-                        fmt::format(
+                        std::format(
                             "checkAllActiveSensors(): OCC{} is ACTIVE (queued)",
                             instance)
                             .c_str());
@@ -201,7 +201,7 @@
                     if (!tracedSensorWait)
                     {
                         log<level::INFO>(
-                            fmt::format(
+                            std::format(
                                 "checkAllActiveSensors(): Waiting on OCC{} Active sensor",
                                 instance)
                                 .c_str());
@@ -320,7 +320,7 @@
     if (statusObjects.back()->isMasterOcc())
     {
         log<level::INFO>(
-            fmt::format("Manager::createObjects(): OCC{} is the master",
+            std::format("Manager::createObjects(): OCC{} is the master",
                         statusObjects.back()->getOccInstanceID())
                 .c_str());
         _pollTimer->setEnabled(false);
@@ -373,7 +373,7 @@
         if (!_pollTimer->isEnabled())
         {
             log<level::INFO>(
-                fmt::format("Manager: OCCs will be polled every {} seconds",
+                std::format("Manager: OCCs will be polled every {} seconds",
                             pollInterval)
                     .c_str());
 
@@ -391,7 +391,7 @@
         else
         {
             log<level::ERR>(
-                fmt::format("OCC{} disabled, but currently no active OCCs",
+                std::format("OCC{} disabled, but currently no active OCCs",
                             instance)
                     .c_str());
         }
@@ -471,7 +471,7 @@
     if (obj != statusObjects.end() && (*obj)->occActive())
     {
         log<level::INFO>(
-            fmt::format("SBE timeout, requesting HRESET (OCC{})", instance)
+            std::format("SBE timeout, requesting HRESET (OCC{})", instance)
                 .c_str());
 
         setSBEState(instance, SBE_STATE_NOT_USABLE);
@@ -493,7 +493,7 @@
         if (!hostRunning && (status == true))
         {
             log<level::WARNING>(
-                fmt::format(
+                std::format(
                     "updateOCCActive: Host is not running yet (OCC{} active={}), clearing sensor received",
                     instance, status)
                     .c_str());
@@ -509,7 +509,7 @@
         }
         else
         {
-            log<level::INFO>(fmt::format("updateOCCActive: OCC{} active={}",
+            log<level::INFO>(std::format("updateOCCActive: OCC{} active={}",
                                          instance, status)
                                  .c_str());
             (*obj)->setPldmSensorReceived(true);
@@ -521,7 +521,7 @@
         if (hostRunning)
         {
             log<level::WARNING>(
-                fmt::format(
+                std::format(
                     "updateOCCActive: No status object to update for OCC{} (active={})",
                     instance, status)
                     .c_str());
@@ -531,7 +531,7 @@
             if (status == true)
             {
                 log<level::WARNING>(
-                    fmt::format(
+                    std::format(
                         "updateOCCActive: No status objects and Host is not running yet (OCC{} active={})",
                         instance, status)
                         .c_str());
@@ -573,7 +573,7 @@
     if (success)
     {
         log<level::INFO>(
-            fmt::format("HRESET succeeded (OCC{})", instance).c_str());
+            std::format("HRESET succeeded (OCC{})", instance).c_str());
 
         setSBEState(instance, SBE_STATE_BOOTED);
 
@@ -585,7 +585,7 @@
     if (sbeCanDump(instance))
     {
         log<level::INFO>(
-            fmt::format("HRESET failed (OCC{}), triggering SBE dump", instance)
+            std::format("HRESET failed (OCC{}), triggering SBE dump", instance)
                 .c_str());
 
         auto& bus = utils::getBus();
@@ -753,7 +753,7 @@
     {
         // No OCCs running, so poll timer will not be restarted
         log<level::INFO>(
-            fmt::format(
+            std::format(
                 "Manager::pollerTimerExpired: poll timer will not be restarted")
                 .c_str());
     }
@@ -785,7 +785,7 @@
         catch (const std::system_error& e)
         {
             log<level::DEBUG>(
-                fmt::format("readTempSensors: Failed reading {}, errno = {}",
+                std::format("readTempSensors: Failed reading {}, errno = {}",
                             file.path().string(), e.code().value())
                     .c_str());
             continue;
@@ -803,7 +803,7 @@
         catch (const std::system_error& e)
         {
             log<level::DEBUG>(
-                fmt::format("readTempSensors: Failed reading {}, errno = {}",
+                std::format("readTempSensors: Failed reading {}, errno = {}",
                             filePathString + fruTypeSuffix, e.code().value())
                     .c_str());
             continue;
@@ -843,7 +843,7 @@
                 if (iter == dimmTempSensorName.end())
                 {
                     log<level::ERR>(
-                        fmt::format(
+                        std::format(
                             "readTempSensors: Fru type error! fruTypeValue = {}) ",
                             fruTypeValue)
                             .c_str());
@@ -898,7 +898,7 @@
             catch (const std::system_error& e)
             {
                 log<level::DEBUG>(
-                    fmt::format(
+                    std::format(
                         "readTempSensors: Failed reading {}, errno = {}",
                         filePathString + maxSuffix, e.code().value())
                         .c_str());
@@ -913,7 +913,7 @@
         catch (const std::system_error& e)
         {
             log<level::DEBUG>(
-                fmt::format("readTempSensors: Failed reading {}, errno = {}",
+                std::format("readTempSensors: Failed reading {}, errno = {}",
                             filePathString + faultSuffix, e.code().value())
                     .c_str());
             continue;
@@ -935,7 +935,7 @@
             catch (const std::system_error& e)
             {
                 log<level::DEBUG>(
-                    fmt::format(
+                    std::format(
                         "readTempSensors: Failed reading {}, errno = {}",
                         filePathString + inputSuffix, e.code().value())
                         .c_str());
@@ -1049,7 +1049,7 @@
         catch (const std::system_error& e)
         {
             log<level::DEBUG>(
-                fmt::format("readPowerSensors: Failed reading {}, errno = {}",
+                std::format("readPowerSensors: Failed reading {}, errno = {}",
                             file.path().string(), e.code().value())
                     .c_str());
             continue;
@@ -1083,7 +1083,7 @@
         catch (const std::system_error& e)
         {
             log<level::DEBUG>(
-                fmt::format("readPowerSensors: Failed reading {}, errno = {}",
+                std::format("readPowerSensors: Failed reading {}, errno = {}",
                             filePathString + inputSuffix, e.code().value())
                     .c_str());
             continue;
@@ -1164,7 +1164,7 @@
         if (!tracedError[id])
         {
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "Manager::getSensorValues: OCC{} sensor path missing: {}",
                     id, sensorPath.c_str())
                     .c_str());
@@ -1198,7 +1198,7 @@
                 // Round to nearest meter
                 altitude = uint16_t(sensorVal + 0.5);
             }
-            log<level::DEBUG>(fmt::format("readAltitude: sensor={} ({}m)",
+            log<level::DEBUG>(std::format("readAltitude: sensor={} ({}m)",
                                           sensorVal, altitude)
                                   .c_str());
             traceAltitudeErr = true;
@@ -1209,7 +1209,7 @@
             {
                 traceAltitudeErr = false;
                 log<level::DEBUG>(
-                    fmt::format("Invalid altitude value: {}", sensorVal)
+                    std::format("Invalid altitude value: {}", sensorVal)
                         .c_str());
             }
         }
@@ -1220,7 +1220,7 @@
         {
             traceAltitudeErr = false;
             log<level::INFO>(
-                fmt::format("Unable to read Altitude: {}", e.what()).c_str());
+                std::format("Unable to read Altitude: {}", e.what()).c_str());
         }
         altitude = 0xFFFF; // not available
     }
@@ -1263,7 +1263,7 @@
     if (truncatedTemp != ambient)
     {
         log<level::DEBUG>(
-            fmt::format("ambientCallback: Ambient change from {} to {}C",
+            std::format("ambientCallback: Ambient change from {} to {}C",
                         ambient, currentTemp)
                 .c_str());
 
@@ -1275,7 +1275,7 @@
         }
 
         log<level::DEBUG>(
-            fmt::format("ambientCallback: Ambient: {}C, altitude: {}m", ambient,
+            std::format("ambientCallback: Ambient: {}C, altitude: {}m", ambient,
                         altitude)
                 .c_str());
 #ifdef POWER10
@@ -1314,7 +1314,7 @@
     {
         // Not all OCCs went active
         log<level::WARNING>(
-            fmt::format(
+            std::format(
                 "occsNotAllRunning: Active OCC count ({}) does not match expected count ({})",
                 activeCount, statusObjects.size())
                 .c_str());
@@ -1343,7 +1343,7 @@
                 {
                     queuedActiveState.erase(match);
                     log<level::INFO>(
-                        fmt::format(
+                        std::format(
                             "validateOccMaster: OCC{} is ACTIVE (queued)",
                             instance)
                             .c_str());
@@ -1356,7 +1356,7 @@
                     if (obj->occActive())
                     {
                         log<level::INFO>(
-                            fmt::format(
+                            std::format(
                                 "validateOccMaster: OCC{} is ACTIVE after reading sensor",
                                 instance)
                                 .c_str());
@@ -1366,7 +1366,7 @@
             else
             {
                 log<level::WARNING>(
-                    fmt::format(
+                    std::format(
                         "validateOccMaster: HOST is not running (OCC{})",
                         instance)
                         .c_str());
@@ -1386,7 +1386,7 @@
             else
             {
                 log<level::ERR>(
-                    fmt::format(
+                    std::format(
                         "validateOccMaster: Multiple OCC masters! ({} and {})",
                         masterInstance, instance)
                         .c_str());
@@ -1399,7 +1399,7 @@
     if (masterInstance < 0)
     {
         log<level::ERR>(
-            fmt::format("validateOccMaster: Master OCC not found! (of {} OCCs)",
+            std::format("validateOccMaster: Master OCC not found! (of {} OCCs)",
                         statusObjects.size())
                 .c_str());
         // request reset
@@ -1409,7 +1409,7 @@
     else
     {
         log<level::INFO>(
-            fmt::format("validateOccMaster: OCC{} is master of {} OCCs",
+            std::format("validateOccMaster: OCC{} is master of {} OCCs",
                         masterInstance, activeCount)
                 .c_str());
 #ifdef POWER10
diff --git a/occ_pass_through.cpp b/occ_pass_through.cpp
index 6834398..77cd064 100644
--- a/occ_pass_through.cpp
+++ b/occ_pass_through.cpp
@@ -4,7 +4,6 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <fmt/core.h>
 #include <unistd.h>
 
 #include <org/open_power/OCC/Device/error.hpp>
@@ -13,6 +12,7 @@
 #include <phosphor-logging/log.hpp>
 
 #include <algorithm>
+#include <format>
 #include <memory>
 #include <string>
 
@@ -77,7 +77,7 @@
     if (!occActive)
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "PassThrough::send() - OCC{} not active, command not sent",
                 occInstance)
                 .c_str());
@@ -85,7 +85,7 @@
     }
 
     log<level::INFO>(
-        fmt::format("PassThrough::send() Sending 0x{:02X} command to OCC{}",
+        std::format("PassThrough::send() Sending 0x{:02X} command to OCC{}",
                     command.front(), occInstance)
             .c_str());
     CmdStatus status = occCmd.send(command, response);
@@ -94,7 +94,7 @@
         if (response.size() >= 5)
         {
             log<level::DEBUG>(
-                fmt::format("PassThrough::send() response had {} bytes",
+                std::format("PassThrough::send() response had {} bytes",
                             response.size())
                     .c_str());
         }
@@ -107,7 +107,7 @@
     else
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "PassThrough::send(): OCC command failed with status {}",
                 uint32_t(status))
                 .c_str());
@@ -125,7 +125,7 @@
         (!VALID_OEM_POWER_MODE_SETTING(newMode)))
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "PassThrough::setMode() Unsupported mode {} requested (0x{:04X})",
                 newMode, modeData)
                 .c_str());
@@ -136,7 +136,7 @@
         (modeData == 0))
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "PassThrough::setMode() Mode {} requires non-zero frequency point.",
                 newMode)
                 .c_str());
@@ -150,13 +150,13 @@
     }
 
     log<level::INFO>(
-        fmt::format("PassThrough::setMode() Setting Power Mode {} (data: {})",
+        std::format("PassThrough::setMode() Setting Power Mode {} (data: {})",
                     newMode, modeData)
             .c_str());
     return pmode->setMode(newMode, modeData);
 #else
     log<level::DEBUG>(
-        fmt::format(
+        std::format(
             "PassThrough::setMode() No support to setting Power Mode {} (data: {})",
             mode, modeData)
             .c_str());
diff --git a/occ_pass_through.hpp b/occ_pass_through.hpp
index f11695c..3cc462b 100644
--- a/occ_pass_through.hpp
+++ b/occ_pass_through.hpp
@@ -4,13 +4,12 @@
 #include "powermode.hpp"
 #include "utils.hpp"
 
-#include <fmt/core.h>
-
 #include <org/open_power/OCC/PassThrough/server.hpp>
 #include <phosphor-logging/log.hpp>
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/server/object.hpp>
 
+#include <format>
 #include <string>
 
 namespace open_power
diff --git a/occ_presence.cpp b/occ_presence.cpp
index a8a5115..73ccf66 100644
--- a/occ_presence.cpp
+++ b/occ_presence.cpp
@@ -46,7 +46,7 @@
     auto occsPresent = std::stoi(data, nullptr, 0);
     if (manager.getNumOCCs() != occsPresent)
     {
-        log<level::ERR>(fmt::format("OCC presence mismatch - BMC: {}, OCC: {}",
+        log<level::ERR>(std::format("OCC presence mismatch - BMC: {}, OCC: {}",
                                     manager.getNumOCCs(), occsPresent)
                             .c_str());
         if (callBack)
diff --git a/occ_status.cpp b/occ_status.cpp
index b89e469..078447c 100644
--- a/occ_status.cpp
+++ b/occ_status.cpp
@@ -5,11 +5,10 @@
 #include "powermode.hpp"
 #include "utils.hpp"
 
-#include <fmt/core.h>
-
 #include <phosphor-logging/log.hpp>
 
 #include <filesystem>
+#include <format>
 
 namespace open_power
 {
@@ -26,7 +25,7 @@
 {
     if (value != this->occActive())
     {
-        log<level::INFO>(fmt::format("Status::occActive OCC{} changed to {}",
+        log<level::INFO>(std::format("Status::occActive OCC{} changed to {}",
                                      instance, value)
                              .c_str());
         if (value)
@@ -148,7 +147,7 @@
 void Status::resetOCC()
 {
     log<level::INFO>(
-        fmt::format(">>Status::resetOCC() - requesting reset for OCC{}",
+        std::format(">>Status::resetOCC() - requesting reset for OCC{}",
                     instance)
             .c_str());
 #ifdef PLDM
@@ -221,7 +220,7 @@
     if (status != CmdStatus::SUCCESS)
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "Status::occsWentActive: OCC mode change failed with status {}",
                 status)
                 .c_str());
@@ -234,7 +233,7 @@
     if (status != CmdStatus::SUCCESS)
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "Status::occsWentActive: Sending Idle Power Save Config data failed with status {}",
                 status)
                 .c_str());
@@ -260,7 +259,7 @@
         // Get latest readings from manager
         manager.getAmbientData(ambientValid, ambientTemp, altitude);
         log<level::DEBUG>(
-            fmt::format("sendAmbient: valid: {}, Ambient: {}C, altitude: {}m",
+            std::format("sendAmbient: valid: {}, Ambient: {}C, altitude: {}m",
                         ambientValid, ambientTemp, altitude)
                 .c_str());
     }
@@ -278,7 +277,7 @@
     cmd.push_back(0x00);                    // Reserved (3 bytes)
     cmd.push_back(0x00);
     cmd.push_back(0x00);
-    log<level::DEBUG>(fmt::format("sendAmbient: SEND_AMBIENT "
+    log<level::DEBUG>(std::format("sendAmbient: SEND_AMBIENT "
                                   "command to OCC{} ({} bytes)",
                                   instance, cmd.size())
                           .c_str());
@@ -290,7 +289,7 @@
             if (RspStatus::SUCCESS != RspStatus(rsp[2]))
             {
                 log<level::ERR>(
-                    fmt::format(
+                    std::format(
                         "sendAmbient: SEND_AMBIENT failed with rspStatus 0x{:02X}",
                         rsp[2])
                         .c_str());
@@ -301,7 +300,7 @@
         else
         {
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "sendAmbient: INVALID SEND_AMBIENT response length:{}",
                     rsp.size())
                     .c_str());
@@ -312,7 +311,7 @@
     else
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "sendAmbient: SEND_AMBIENT FAILED! with status 0x{:02X}",
                 status)
                 .c_str());
@@ -333,7 +332,7 @@
     if (this->occActive())
     {
         log<level::INFO>(
-            fmt::format(
+            std::format(
                 "safeStateDelayExpired: OCC{} is in SAFE state, requesting reset",
                 instance)
                 .c_str());
@@ -354,7 +353,7 @@
         if (!hwmonPath.empty())
         {
             log<level::ERR>(
-                fmt::format("Status::getHwmonPath(): path no longer exists: {}",
+                std::format("Status::getHwmonPath(): path no longer exists: {}",
                             hwmonPath.c_str())
                     .c_str());
             hwmonPath.clear();
@@ -381,7 +380,7 @@
                 if (!tracedFail[instance])
                 {
                     log<level::ERR>(
-                        fmt::format(
+                        std::format(
                             "Status::getHwmonPath(): Found multiple ({}) hwmon paths!",
                             numDirs)
                             .c_str());
@@ -394,7 +393,7 @@
             if (!tracedFail[instance])
             {
                 log<level::ERR>(
-                    fmt::format(
+                    std::format(
                         "Status::getHwmonPath(): error accessing {}: {}",
                         prefixPath.c_str(), e.what())
                         .c_str());
@@ -431,7 +430,7 @@
         {
             // Trace OCC state changes
             log<level::INFO>(
-                fmt::format(
+                std::format(
                     "Status::readOccState: OCC{} state 0x{:02X} (lastState: 0x{:02X})",
                     instance, state, lastState)
                     .c_str());
@@ -454,7 +453,7 @@
                 if (status != CmdStatus::SUCCESS)
                 {
                     log<level::ERR>(
-                        fmt::format(
+                        std::format(
                             "readOccState: Sending Ambient failed with status {}",
                             status)
                             .c_str());
@@ -505,7 +504,7 @@
         {
             // If not able to read, OCC may be offline
             log<level::ERR>(
-                fmt::format("Status::readOccState: open failed (errno={})",
+                std::format("Status::readOccState: open failed (errno={})",
                             openErrno)
                     .c_str());
         }
@@ -515,7 +514,7 @@
             if (state != lastState)
             {
                 log<level::ERR>(
-                    fmt::format(
+                    std::format(
                         "Status::readOccState: OCC{} Invalid state 0x{:02X} (last state: 0x{:02X})",
                         instance, state, lastState)
                         .c_str());
@@ -598,7 +597,7 @@
         if (newThrottleCause == THROTTLED_NONE)
         {
             log<level::DEBUG>(
-                fmt::format(
+                std::format(
                     "updateThrottle: OCC{} no longer throttled (prior reason: {})",
                     instance, throttleCause)
                     .c_str());
@@ -609,7 +608,7 @@
         else
         {
             log<level::DEBUG>(
-                fmt::format(
+                std::format(
                     "updateThrottle: OCC{} is throttled with reason {} (prior reason: {})",
                     instance, newThrottleCause, throttleCause)
                     .c_str());
@@ -643,7 +642,7 @@
 {
     std::string managingPath = path + "/power_managing";
     log<level::DEBUG>(
-        fmt::format("readProcAssociation: getting endpoints for {} ({})",
+        std::format("readProcAssociation: getting endpoints for {} ({})",
                     managingPath, path)
             .c_str());
     try
@@ -656,14 +655,14 @@
         {
             procPath = result[0];
             log<level::INFO>(
-                fmt::format("readProcAssociation: OCC{} has proc={}", instance,
+                std::format("readProcAssociation: OCC{} has proc={}", instance,
                             procPath.c_str())
                     .c_str());
         }
         else
         {
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "readProcAssociation: No processor associated with OCC{} / {}",
                     instance, path)
                     .c_str());
@@ -672,7 +671,7 @@
     catch (const sdbusplus::exception_t& e)
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "readProcAssociation: Unable to get proc assocated with {} - {}",
                 path, e.what())
                 .c_str());
diff --git a/pldm.cpp b/pldm.cpp
index 3c71eb9..fe38879 100644
--- a/pldm.cpp
+++ b/pldm.cpp
@@ -2,7 +2,6 @@
 
 #include "file.hpp"
 
-#include <fmt/core.h>
 #include <libpldm/entity.h>
 #include <libpldm/platform.h>
 #include <libpldm/state_set.h>
@@ -16,6 +15,7 @@
 #include <sdeventplus/source/time.hpp>
 
 #include <algorithm>
+#include <format>
 
 namespace pldm
 {
@@ -51,7 +51,7 @@
         if (!tracedError)
         {
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "fetchSensorInfo: Failed to find stateSetID:{} PDR: {}",
                     stateSetId, e.what())
                     .c_str());
@@ -64,7 +64,7 @@
         if (!tracedError)
         {
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "fetchSensorInfo: state sensor PDRs ({}) not present",
                     stateSetId)
                     .c_str());
@@ -77,7 +77,7 @@
     if (tracedError)
     {
         log<level::INFO>(
-            fmt::format("fetchSensorInfo: found {} PDRs", pdrs.size()).c_str());
+            std::format("fetchSensorInfo: found {} PDRs", pdrs.size()).c_str());
         tracedError = false;
     }
 
@@ -165,7 +165,7 @@
                     PLDM_STATE_SET_OPERATIONAL_RUNNING_STATUS_IN_SERVICE))
             {
                 log<level::INFO>(
-                    fmt::format("PLDM: OCC{} is RUNNING", instance).c_str());
+                    std::format("PLDM: OCC{} is RUNNING", instance).c_str());
                 isRunning = true;
             }
             else if (eventState ==
@@ -173,7 +173,7 @@
                          PLDM_STATE_SET_OPERATIONAL_RUNNING_STATUS_STOPPED))
             {
                 log<level::INFO>(
-                    fmt::format("PLDM: OCC{} has now STOPPED", instance)
+                    std::format("PLDM: OCC{} has now STOPPED", instance)
                         .c_str());
             }
             else if (eventState ==
@@ -181,7 +181,7 @@
                          PLDM_STATE_SET_OPERATIONAL_RUNNING_STATUS_DORMANT))
             {
                 log<level::INFO>(
-                    fmt::format(
+                    std::format(
                         "PLDM: OCC{} has now STOPPED and system is in SAFE MODE",
                         instance)
                         .c_str());
@@ -192,7 +192,7 @@
             else
             {
                 log<level::INFO>(
-                    fmt::format("PLDM: Unexpected PLDM state {} for OCC{}",
+                    std::format("PLDM: Unexpected PLDM state {} for OCC{}",
                                 eventState, instance)
                         .c_str());
             }
@@ -218,7 +218,7 @@
                 if (eventState == static_cast<EventState>(SBE_HRESET_NOT_READY))
                 {
                     log<level::INFO>(
-                        fmt::format("pldm: HRESET is NOT READY (OCC{})",
+                        std::format("pldm: HRESET is NOT READY (OCC{})",
                                     instance)
                             .c_str());
                 }
@@ -260,13 +260,13 @@
     if (!sensorToOCCInstance.empty())
     {
         log<level::INFO>(
-            fmt::format("clearData: Clearing sensorToOCCInstance ({} entries)",
+            std::format("clearData: Clearing sensorToOCCInstance ({} entries)",
                         sensorToOCCInstance.size())
                 .c_str());
         for (auto entry : sensorToOCCInstance)
         {
             log<level::INFO>(
-                fmt::format("clearData: OCC{} / sensorID: 0x{:04X}",
+                std::format("clearData: OCC{} / sensorID: 0x{:04X}",
                             entry.second, entry.first)
                     .c_str());
             callBack(entry.second, false);
@@ -276,7 +276,7 @@
     if (!occInstanceToEffecter.empty())
     {
         log<level::DEBUG>(
-            fmt::format(
+            std::format(
                 "clearData: Clearing occInstanceToEffecter ({} entries)",
                 occInstanceToEffecter.size())
                 .c_str());
@@ -285,7 +285,7 @@
     if (!sensorToSBEInstance.empty())
     {
         log<level::DEBUG>(
-            fmt::format("clearData: Clearing sensorToSBEInstance ({} entries)",
+            std::format("clearData: Clearing sensorToSBEInstance ({} entries)",
                         sensorToSBEInstance.size())
                 .c_str());
         sensorToSBEInstance.clear();
@@ -293,7 +293,7 @@
     if (!sbeInstanceToEffecter.empty())
     {
         log<level::DEBUG>(
-            fmt::format(
+            std::format(
                 "clearData: Clearing sbeInstanceToEffecter ({} entries)",
                 sbeInstanceToEffecter.size())
                 .c_str());
@@ -433,7 +433,7 @@
         if (effecterEntry == occInstanceToEffecter.end())
         {
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "pldm: Failed to find a matching effecter for OCC instance {}",
                     occInstanceId)
                     .c_str());
@@ -459,7 +459,7 @@
     else
     {
         log<level::ERR>(
-            fmt::format("resetOCC: HOST is not running (OCC{})", occInstanceId)
+            std::format("resetOCC: HOST is not running (OCC{})", occInstanceId)
                 .c_str());
         clearData();
     }
@@ -503,7 +503,7 @@
     }
     else
     {
-        log<level::ERR>(fmt::format("sendHRESET: HOST is not running (OCC{})",
+        log<level::ERR>(std::format("sendHRESET: HOST is not running (OCC{})",
                                     sbeInstanceId)
                             .c_str());
         clearData();
@@ -526,14 +526,14 @@
             uint8_t newInstanceId;
             reply.read(newInstanceId);
             mctpInstance = newInstanceId;
-            log<level::INFO>(fmt::format("pldm: got new InstanceId: {}",
+            log<level::INFO>(std::format("pldm: got new InstanceId: {}",
                                          mctpInstance.value())
                                  .c_str());
         }
         catch (const sdbusplus::exception_t& e)
         {
             log<level::ERR>(
-                fmt::format("pldm: GetInstanceId failed: {}", e.what())
+                std::format("pldm: GetInstanceId failed: {}", e.what())
                     .c_str());
             return false;
         }
@@ -557,7 +557,7 @@
     if (pldmFd == PLDM_REQUESTER_OPEN_FAIL)
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "sendPldm: Failed to connect to MCTP socket, errno={}/{}",
                 openErrno, strerror(openErrno))
                 .c_str());
@@ -572,7 +572,7 @@
 
         // Send PLDM request
         log<level::INFO>(
-            fmt::format(
+            std::format(
                 "sendPldm: calling pldm_send(OCC{}, instance:{}, {} bytes)",
                 instance, mctpInstance.value(), request.size())
                 .c_str());
@@ -585,7 +585,7 @@
         if (pldmRc != PLDM_REQUESTER_SUCCESS)
         {
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "sendPldm: pldm_send failed with rc={} and errno={}/{}",
                     static_cast<
                         std::underlying_type_t<pldm_requester_error_codes>>(
@@ -605,7 +605,7 @@
     else // not expecting the response
     {
         log<level::INFO>(
-            fmt::format(
+            std::format(
                 "sendPldm: calling pldm_send(mctpID:{}, fd:{}, {} bytes) for OCC{}",
                 mctpEid, pldmFd, request.size(), instance)
                 .c_str());
@@ -614,7 +614,7 @@
         if (rc)
         {
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "sendPldm: pldm_send(mctpID:{}, fd:{}, {} bytes) failed with rc={} and errno={}/{}",
                     mctpEid, pldmFd, request.size(),
                     static_cast<
@@ -640,7 +640,7 @@
     if (rc < 0)
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "registerPldmRspCallback: sd_event_add_io: Error({})={} : fd={}",
                 rc, strerror(-rc), pldmFd)
                 .c_str());
@@ -658,7 +658,7 @@
     if (!pldmResponseReceived)
     {
         log<level::WARNING>(
-            fmt::format(
+            std::format(
                 "pldmRspExpired: timerCallback - timeout waiting for pldm response for OCC{}",
                 pldmResponseOcc)
                 .c_str());
@@ -689,7 +689,7 @@
     if (!(revents & EPOLLIN))
     {
         log<level::INFO>(
-            fmt::format("pldmRspCallback - revents={:08X}", revents).c_str());
+            std::format("pldmRspCallback - revents={:08X}", revents).c_str());
         return -1;
     }
 
@@ -706,7 +706,7 @@
     size_t responseMsgSize{};
 
     log<level::INFO>(
-        fmt::format("pldmRspCallback: calling pldm_recv() instance:{}",
+        std::format("pldmRspCallback: calling pldm_recv() instance:{}",
                     pldmIface->mctpInstance.value())
             .c_str());
     auto rc = pldm_recv(mctpEid, fd, pldmIface->mctpInstance.value(),
@@ -715,7 +715,7 @@
     if (rc)
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "pldmRspCallback: pldm_recv failed with rc={}, errno={}/{}",
                 static_cast<std::underlying_type_t<pldm_requester_error_codes>>(
                     rc),
@@ -726,7 +726,7 @@
 
     // We got the response for the PLDM request msg that was sent
     log<level::INFO>(
-        fmt::format("pldmRspCallback: pldm_recv() rsp was {} bytes",
+        std::format("pldmRspCallback: pldm_recv() rsp was {} bytes",
                     responseMsgSize)
             .c_str());
 
@@ -747,7 +747,7 @@
     if (response->payload[0] != PLDM_SUCCESS)
     {
         log<level::ERR>(
-            fmt::format("pldmRspCallback: payload[0] was not success: {}",
+            std::format("pldmRspCallback: payload[0] was not success: {}",
                         response->payload[0])
                 .c_str());
         pldmIface->pldmClose();
@@ -763,7 +763,7 @@
     if ((msgRc != PLDM_SUCCESS) || (compCode != PLDM_SUCCESS))
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "pldmRspCallback: decode_get_state_sensor_readings failed with rc={} and compCode={}",
                 msgRc, compCode)
                 .c_str());
@@ -780,14 +780,14 @@
     if (occSensorState == PLDM_STATE_SET_OPERATIONAL_RUNNING_STATUS_IN_SERVICE)
     {
         log<level::INFO>(
-            fmt::format("pldmRspCallback: OCC{} is RUNNING", instance).c_str());
+            std::format("pldmRspCallback: OCC{} is RUNNING", instance).c_str());
         pldmIface->callBack(instance, true);
     }
     else if (occSensorState ==
              PLDM_STATE_SET_OPERATIONAL_RUNNING_STATUS_DORMANT)
     {
         log<level::INFO>(
-            fmt::format(
+            std::format(
                 "pldmRspCallback: OCC{} has now STOPPED and system is in SAFE MODE",
                 instance)
                 .c_str());
@@ -800,7 +800,7 @@
     else
     {
         log<level::INFO>(
-            fmt::format(
+            std::format(
                 "pldmRspCallback: OCC{} is not running (sensor state:{})",
                 instance, occSensorState)
                 .c_str());
@@ -811,7 +811,7 @@
             memcpy(&pldmResponse[0], reinterpret_cast<std::uint8_t*>(response),
                    rspLength);
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "pldmRspCallback: Bad State - PLDM response ({} bytes) for OCC{}:",
                     rspLength, instance)
                     .c_str());
@@ -844,7 +844,7 @@
     if (msgRc != PLDM_SUCCESS)
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "encodeGetStateSensorRequest: Failed to encode sensorId:0x{:08X} for OCC{} (rc={})",
                 sensorId, instance, msgRc)
                 .c_str());
@@ -861,7 +861,7 @@
         if (!tracedOnce)
         {
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "checkActiveSensor: already waiting on OCC{} (fd={})",
                     pldmResponseOcc, pldmFd)
                     .c_str());
@@ -886,7 +886,7 @@
         // Query the OCC Active Sensor state for this instance
         // SensorID sID = entry->first;
         log<level::INFO>(
-            fmt::format("checkActiveSensor: OCC{} / sensorID: 0x{:04X}",
+            std::format("checkActiveSensor: OCC{} / sensorID: 0x{:04X}",
                         instance, entry->first)
                 .c_str());
 
@@ -903,7 +903,7 @@
     else
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "checkActiveSensor: Unable to find PLDM sensor for OCC{}",
                 instance)
                 .c_str());
diff --git a/powercap.cpp b/powercap.cpp
index edfae9c..be9f90e 100644
--- a/powercap.cpp
+++ b/powercap.cpp
@@ -1,12 +1,11 @@
 #include "occ_status.hpp"
 
-#include <fmt/core.h>
-
 #include <phosphor-logging/log.hpp>
 #include <powercap.hpp>
 
 #include <cassert>
 #include <filesystem>
+#include <format>
 
 namespace open_power
 {
@@ -52,7 +51,7 @@
     else
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "updatePcapBounds: unable to find pcap_min_soft file: {} (errno={})",
                 pcapBasePathname.c_str(), errno)
                 .c_str());
@@ -69,7 +68,7 @@
     else
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "updatePcapBounds: unable to find cap_min file: {} (errno={})",
                 pcapBasePathname.c_str(), errno)
                 .c_str());
@@ -86,7 +85,7 @@
     else
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "updatePcapBounds: unable to find cap_max file: {} (errno={})",
                 pcapBasePathname.c_str(), errno)
                 .c_str());
@@ -108,7 +107,7 @@
             {
                 // User power cap is enabled, but does not match dbus
                 log<level::ERR>(
-                    fmt::format(
+                    std::format(
                         "updatePcapBounds: user powercap mismatch (hwmon:{}W, bdus:{}W) - using dbus",
                         hwmonUserCap, dbusUserCap)
                         .c_str());
@@ -125,7 +124,7 @@
                 newCap = capSoftMin;
             }
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "updatePcapBounds: user powercap {}W is outside bounds "
                     "(soft min:{}, min:{}, max:{})",
                     dbusUserCap, capSoftMin, capHardMin, capMax)
@@ -133,7 +132,7 @@
             try
             {
                 log<level::INFO>(
-                    fmt::format(
+                    std::format(
                         "updatePcapBounds: Updating user powercap from {} to {}W",
                         hwmonUserCap, newCap)
                         .c_str());
@@ -145,7 +144,7 @@
             catch (const sdbusplus::exception_t& e)
             {
                 log<level::ERR>(
-                    fmt::format(
+                    std::format(
                         "updatePcapBounds: Failed to update user powercap due to ",
                         e.what())
                         .c_str());
@@ -228,7 +227,7 @@
     }
     else
     {
-        log<level::ERR>(fmt::format("Power Cap base filename not found: {}",
+        log<level::ERR>(std::format("Power Cap base filename not found: {}",
                                     pcapBasePathname.c_str())
                             .c_str());
     }
@@ -252,7 +251,7 @@
     if (fileName.empty())
     {
         log<level::ERR>(
-            fmt::format("Could not find a power cap file to write to: {})",
+            std::format("Could not find a power cap file to write to: {})",
                         pcapBasePathname.c_str())
                 .c_str());
         return;
@@ -266,7 +265,7 @@
     std::ofstream file(fileName, std::ios::out);
     if (file)
     {
-        log<level::INFO>(fmt::format("Writing {}uW to {}", pcapString.c_str(),
+        log<level::INFO>(std::format("Writing {}uW to {}", pcapString.c_str(),
                                      fileName.c_str())
                              .c_str());
         file << pcapString;
@@ -274,7 +273,7 @@
     }
     else
     {
-        log<level::ERR>(fmt::format("Failed writing {}uW to {} (errno={})",
+        log<level::ERR>(std::format("Failed writing {}uW to {} (errno={})",
                                     microWatts, fileName.c_str(), errno)
                             .c_str());
     }
@@ -292,7 +291,7 @@
     if (userCapName.empty())
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "readUserCapHwmon: Could not find a power cap file to read: {})",
                 pcapBasePathname.c_str())
                 .c_str());
@@ -312,7 +311,7 @@
     else
     {
         log<level::ERR>(
-            fmt::format("readUserCapHwmon: Failed reading {} (errno={})",
+            std::format("readUserCapHwmon: Failed reading {} (errno={})",
                         userCapName.c_str(), errno)
                 .c_str());
     }
@@ -354,7 +353,7 @@
         {
             // Ignore other properties
             log<level::DEBUG>(
-                fmt::format(
+                std::format(
                     "pcapChanged: Unknown power cap property changed {} to {}",
                     prop.c_str(), std::get<uint32_t>(value))
                     .c_str());
@@ -367,7 +366,7 @@
     if (((pcap > 0) && (pcap < capSoftMin)) || ((pcap == 0) && (pcapEnabled)))
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "pcapChanged: Power cap of {}W is lower than allowed (soft min:{}, min:{}) - using soft min",
                 pcap, capSoftMin, capHardMin)
                 .c_str());
@@ -377,7 +376,7 @@
     else if (pcap > capMax)
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "pcapChanged: Power cap of {}W is higher than allowed (max:{}) - using max",
                 pcap, capSoftMin, capHardMin)
                 .c_str());
@@ -388,7 +387,7 @@
     if (changeFound)
     {
         log<level::INFO>(
-            fmt::format(
+            std::format(
                 "Power Cap Property Change (cap={}W (input), enabled={})", pcap,
                 pcapEnabled ? 'y' : 'n')
                 .c_str());
@@ -416,7 +415,7 @@
     catch (const sdbusplus::exception_t& e)
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "updateDbusPcapLimits: Failed to set SOFT PCAP to {}W due to {}",
                 softMin, e.what())
                 .c_str());
@@ -431,7 +430,7 @@
     catch (const sdbusplus::exception_t& e)
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "updateDbusPcapLimits: Failed to set HARD PCAP to {}W due to {}",
                 hardMin, e.what())
                 .c_str());
@@ -445,7 +444,7 @@
     catch (const sdbusplus::exception_t& e)
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "updateDbusPcapLimits: Failed to set MAX PCAP to {}W due to {}",
                 max, e.what())
                 .c_str());
@@ -471,7 +470,7 @@
     catch (const sdbusplus::exception_t& e)
     {
         log<level::ERR>(
-            fmt::format("readDbusPcapLimits: Failed to get SOFT PCAP due to {}",
+            std::format("readDbusPcapLimits: Failed to get SOFT PCAP due to {}",
                         e.what())
                 .c_str());
         softMin = 0;
@@ -487,7 +486,7 @@
     catch (const sdbusplus::exception_t& e)
     {
         log<level::ERR>(
-            fmt::format("readDbusPcapLimits: Failed to get HARD PCAP due to {}",
+            std::format("readDbusPcapLimits: Failed to get HARD PCAP due to {}",
                         e.what())
                 .c_str());
         hardMin = 0;
@@ -502,7 +501,7 @@
     catch (const sdbusplus::exception_t& e)
     {
         log<level::ERR>(
-            fmt::format("readDbusPcapLimits: Failed to get MAX PCAP due to {}",
+            std::format("readDbusPcapLimits: Failed to get MAX PCAP due to {}",
                         e.what())
                 .c_str());
         max = INT_MAX;
diff --git a/powermode.cpp b/powermode.cpp
index 342188e..88422bf 100644
--- a/powermode.cpp
+++ b/powermode.cpp
@@ -1,9 +1,10 @@
 #include "powermode.hpp"
 
 #include <fcntl.h>
-#include <fmt/core.h>
 #include <sys/ioctl.h>
 
+#include <format>
+
 #ifdef POWERVM_CHECK
 #include <com/ibm/Host/Target/server.hpp>
 #endif
@@ -41,7 +42,7 @@
         if (masterOccPath != path)
         {
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "PowerMode::setMasterOcc: Master changed (was OCC{}, {})",
                     occInstance, masterOccPath)
                     .c_str());
@@ -53,7 +54,7 @@
     }
     path = masterOccPath;
     occInstance = path.back() - '0';
-    log<level::DEBUG>(fmt::format("PowerMode::setMasterOcc(OCC{}, {})",
+    log<level::DEBUG>(std::format("PowerMode::setMasterOcc(OCC{}, {})",
                                   occInstance, path.c_str())
                           .c_str());
     if (!occCmd)
@@ -101,7 +102,7 @@
             persistedData.updateMode(newMode, 0);
 
             log<level::INFO>(
-                fmt::format("DBus Power Mode Changed: {}", propVal).c_str());
+                std::format("DBus Power Mode Changed: {}", propVal).c_str());
 
             // Send mode change to OCC
             sendModeChange();
@@ -121,7 +122,7 @@
 bool PowerMode::powerModeLockStatus()
 {
     bool status = persistedData.getModeLock(); // read persistent data
-    log<level::INFO>(fmt::format("PowerMode::powerModeLockStatus: {}",
+    log<level::INFO>(std::format("PowerMode::powerModeLockStatus: {}",
                                  status ? "locked" : "unlocked")
                          .c_str());
     return status;
@@ -191,7 +192,7 @@
         if (mode != Mode::PowerMode::OEM)
         {
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "convertStringToMode: Invalid Power Mode specified: {}",
                     i_modeString)
                     .c_str());
@@ -229,7 +230,7 @@
     }
 
     log<level::DEBUG>(
-        fmt::format("isPowerVM returning {}", powerVmTarget).c_str());
+        std::format("isPowerVM returning {}", powerVmTarget).c_str());
 #endif
 
     return powerVmTarget;
@@ -248,7 +249,7 @@
             return false;
         }
         log<level::INFO>(
-            fmt::format("PowerMode::initPersistentData: Using default mode: {}",
+            std::format("PowerMode::initPersistentData: Using default mode: {}",
                         currentMode)
                 .c_str());
 
@@ -295,7 +296,7 @@
         !VALID_OEM_POWER_MODE_SETTING(newMode))
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "PowerMode::updateDbusMode - Requested power mode not supported: {}",
                 newMode)
                 .c_str());
@@ -373,7 +374,7 @@
         cmd.push_back(oemModeData & 0xFF); //
         cmd.push_back(0x00);               // reserved
         log<level::INFO>(
-            fmt::format(
+            std::format(
                 "PowerMode::sendModeChange: SET_MODE({},{}) command to OCC{} ({} bytes)",
                 newMode, oemModeData, occInstance, cmd.size())
                 .c_str());
@@ -385,7 +386,7 @@
                 if (RspStatus::SUCCESS != RspStatus(rsp[2]))
                 {
                     log<level::ERR>(
-                        fmt::format(
+                        std::format(
                             "PowerMode::sendModeChange: SET MODE failed with status 0x{:02X}",
                             rsp[2])
                             .c_str());
@@ -404,7 +405,7 @@
         else
         {
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "PowerMode::sendModeChange: SET_MODE FAILED with status={}",
                     status)
                     .c_str());
@@ -413,7 +414,7 @@
     else
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "PowerMode::sendModeChange: Unable to set power mode to {}",
                 newMode)
                 .c_str());
@@ -443,7 +444,7 @@
     {
         ipsEnabled = std::get<bool>(ipsEntry->second);
         log<level::INFO>(
-            fmt::format("Idle Power Saver change: Enabled={}", ipsEnabled)
+            std::format("Idle Power Saver change: Enabled={}", ipsEnabled)
                 .c_str());
         parmsChanged = true;
     }
@@ -452,7 +453,7 @@
     {
         enterUtil = std::get<uint8_t>(ipsEntry->second);
         log<level::INFO>(
-            fmt::format("Idle Power Saver change: Enter Util={}%", enterUtil)
+            std::format("Idle Power Saver change: Enter Util={}%", enterUtil)
                 .c_str());
         parmsChanged = true;
     }
@@ -463,7 +464,7 @@
         enterTime =
             std::chrono::duration_cast<std::chrono::seconds>(ms).count();
         log<level::INFO>(
-            fmt::format("Idle Power Saver change: Enter Time={}sec", enterTime)
+            std::format("Idle Power Saver change: Enter Time={}sec", enterTime)
                 .c_str());
         parmsChanged = true;
     }
@@ -472,7 +473,7 @@
     {
         exitUtil = std::get<uint8_t>(ipsEntry->second);
         log<level::INFO>(
-            fmt::format("Idle Power Saver change: Exit Util={}%", exitUtil)
+            std::format("Idle Power Saver change: Exit Util={}%", exitUtil)
                 .c_str());
         parmsChanged = true;
     }
@@ -482,7 +483,7 @@
         std::chrono::milliseconds ms(std::get<uint64_t>(ipsEntry->second));
         exitTime = std::chrono::duration_cast<std::chrono::seconds>(ms).count();
         log<level::INFO>(
-            fmt::format("Idle Power Saver change: Exit Time={}sec", exitTime)
+            std::format("Idle Power Saver change: Exit Time={}sec", exitTime)
                 .c_str());
         parmsChanged = true;
     }
@@ -544,7 +545,7 @@
     if (enterUtil > exitUtil)
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "ERROR: Idle Power Saver Enter Utilization ({}%) is > Exit Utilization ({}%) - using Exit for both",
                 enterUtil, exitUtil)
                 .c_str());
@@ -595,7 +596,7 @@
     getIPSParms(ipsEnabled, enterUtil, enterTime, exitUtil, exitTime);
 
     log<level::INFO>(
-        fmt::format(
+        std::format(
             "Idle Power Saver Parameters: enabled:{}, enter:{}%/{}s, exit:{}%/{}s",
             ipsEnabled, enterUtil, enterTime, exitUtil, exitTime)
             .c_str());
@@ -614,7 +615,7 @@
     cmd.push_back(exitTime >> 8);      // Exit Delay Time
     cmd.push_back(exitTime & 0xFF);    //
     cmd.push_back(exitUtil);           // Exit Utilization
-    log<level::INFO>(fmt::format("PowerMode::sendIpsData: SET_CFG_DATA[IPS] "
+    log<level::INFO>(std::format("PowerMode::sendIpsData: SET_CFG_DATA[IPS] "
                                  "command to OCC{} ({} bytes)",
                                  occInstance, cmd.size())
                          .c_str());
@@ -626,7 +627,7 @@
             if (RspStatus::SUCCESS != RspStatus(rsp[2]))
             {
                 log<level::ERR>(
-                    fmt::format(
+                    std::format(
                         "PowerMode::sendIpsData: SET_CFG_DATA[IPS] failed with status 0x{:02X}",
                         rsp[2])
                         .c_str());
@@ -645,7 +646,7 @@
     else
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "PowerMode::sendIpsData: SET_CFG_DATA[IPS] with status={}",
                 status)
                 .c_str());
@@ -660,7 +661,7 @@
     if (modeData.modeInitialized)
     {
         log<level::INFO>(
-            fmt::format(
+            std::format(
                 "OccPersistData: Mode: 0x{:02X}, OEM Mode Data: {} (0x{:04X} Locked{})",
                 modeData.mode, modeData.oemModeData, modeData.oemModeData,
                 modeData.modeLocked)
@@ -669,7 +670,7 @@
     if (modeData.ipsInitialized)
     {
         log<level::INFO>(
-            fmt::format(
+            std::format(
                 "OccPersistData: IPS enabled:{}, enter:{}%/{}s, exit:{}%/{}s",
                 modeData.ipsEnabled, modeData.ipsEnterUtil,
                 modeData.ipsEnterTime, modeData.ipsExitUtil,
@@ -690,7 +691,7 @@
     }
 
     log<level::DEBUG>(
-        fmt::format(
+        std::format(
             "OccPersistData::save: Writing Power Mode persisted data to {}",
             opath.c_str())
             .c_str());
@@ -716,7 +717,7 @@
     }
 
     log<level::DEBUG>(
-        fmt::format(
+        std::format(
             "OccPersistData::load: Reading Power Mode persisted data from {}",
             ipath.c_str())
             .c_str());
@@ -730,7 +731,7 @@
     {
         auto error = errno;
         log<level::ERR>(
-            fmt::format("OccPersistData::load: failed to read {}, errno={}",
+            std::format("OccPersistData::load: failed to read {}, errno={}",
                         ipath.c_str(), error)
                 .c_str());
         modeData.modeInitialized = false;
@@ -751,7 +752,7 @@
     if ((!persistedData.modeAvailable()) || (!persistedData.ipsAvailable()))
     {
         log<level::INFO>(
-            fmt::format(
+            std::format(
                 "Default PowerModeProperties are now available (persistent modeAvail={}, ipsAvail={})",
                 persistedData.modeAvailable() ? 'y' : 'n',
                 persistedData.modeAvailable() ? 'y' : 'n')
@@ -787,7 +788,7 @@
         if (!VALID_POWER_MODE_SETTING(defaultMode))
         {
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "PowerMode::getDefaultMode: Invalid default power mode found: {}",
                     defaultMode)
                     .c_str());
@@ -799,7 +800,7 @@
     catch (const sdbusplus::exception_t& e)
     {
         log<level::ERR>(
-            fmt::format("Unable to read Default Power Mode: {}", e.what())
+            std::format("Unable to read Default Power Mode: {}", e.what())
                 .c_str());
         return false;
     }
@@ -839,7 +840,7 @@
     catch (const sdbusplus::exception_t& e)
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "Unable to read Default Idle Power Saver parameters so it will be disabled: {}",
                 e.what())
                 .c_str());
@@ -904,7 +905,7 @@
     if (enterUtil > exitUtil)
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "ERROR: Default Idle Power Saver Enter Utilization ({}%) is > Exit Utilization ({}%) - using Exit for both",
                 enterUtil, exitUtil)
                 .c_str());
@@ -929,7 +930,7 @@
         return false;
     }
     log<level::INFO>(
-        fmt::format(
+        std::format(
             "PowerMode::useDefaultIPSParms: Using default IPS parms: Enabled: {}, EnterUtil: {}%, EnterTime: {}s, ExitUtil: {}%, ExitTime: {}s",
             ipsEnabled, enterUtil, enterTime, exitUtil, exitTime)
             .c_str());
@@ -952,7 +953,7 @@
     const int open_errno = errno;
     if (fd < 0)
     {
-        log<level::ERR>(fmt::format("openIpsFile Error({})={} : File={}",
+        log<level::ERR>(std::format("openIpsFile Error({})={} : File={}",
                                     open_errno, strerror(open_errno),
                                     ipsStatusFile.c_str())
                             .c_str());
@@ -1020,7 +1021,7 @@
                              ipsStatusCallBack, this);
     if (r < 0)
     {
-        log<level::ERR>(fmt::format("sd_event_add_io: Error({})={} : File={}",
+        log<level::ERR>(std::format("sd_event_add_io: Error({})={} : File={}",
                                     r, strerror(-r), ipsStatusFile.c_str())
                             .c_str());
 
@@ -1081,7 +1082,7 @@
             removeIpsWatch();
 
             log<level::ERR>(
-                fmt::format("IPS state Read Error({})={} : File={} : len={}",
+                std::format("IPS state Read Error({})={} : File={} : len={}",
                             readErrno, strerror(readErrno),
                             ipsStatusFile.c_str(), len)
                     .c_str());
@@ -1117,7 +1118,7 @@
 
         // If the Retry did not get to "watching = true" we already have an
         // error log, just post trace.
-        log<level::ERR>(fmt::format("Retry on File seek Error({})={} : File={}",
+        log<level::ERR>(std::format("Retry on File seek Error({})={} : File={}",
                                     open_errno, strerror(open_errno),
                                     ipsStatusFile.c_str())
                             .c_str());
@@ -1150,7 +1151,7 @@
 void PowerMode::updateDbusSafeMode(const bool safeModeReq)
 {
     log<level::DEBUG>(
-        fmt::format("PowerMode:updateDbusSafeMode: Update dbus state ({})",
+        std::format("PowerMode:updateDbusSafeMode: Update dbus state ({})",
                     safeModeReq)
             .c_str());
 
diff --git a/utils.cpp b/utils.cpp
index 97e33dd..4b85604 100644
--- a/utils.cpp
+++ b/utils.cpp
@@ -1,6 +1,5 @@
 #include "utils.hpp"
 
-#include <fmt/core.h>
 #include <systemd/sd-event.h>
 #include <unistd.h>
 
@@ -10,6 +9,7 @@
 #include <xyz/openbmc_project/State/Boot/Progress/server.hpp>
 #include <xyz/openbmc_project/State/Host/server.hpp>
 
+#include <format>
 #include <string>
 namespace open_power
 {
@@ -107,7 +107,7 @@
         if (reply.is_method_error())
         {
             log<level::ERR>(
-                fmt::format("util::setProperty: Failed to set property {}",
+                std::format("util::setProperty: Failed to set property {}",
                             propertyName)
                     .c_str());
         }
@@ -116,7 +116,7 @@
     {
         auto error = errno;
         log<level::ERR>(
-            fmt::format("setProperty: failed to Set {}, errno={}, what={}",
+            std::format("setProperty: failed to Set {}, errno={}, what={}",
                         propertyName.c_str(), error, e.what())
                 .c_str());
     }
@@ -161,7 +161,7 @@
     if (rspObjects.empty())
     {
         log<level::ERR>(
-            fmt::format(
+            std::format(
                 "util::getServiceUsingSubTree: Failed getSubTree({},0,{})",
                 path.c_str(), interface)
                 .c_str());
@@ -176,7 +176,7 @@
         else
         {
             log<level::ERR>(
-                fmt::format(
+                std::format(
                     "getServiceUsingSubTree: service not found for interface {} (path={})",
                     interface, path.c_str())
                     .c_str());
@@ -215,7 +215,7 @@
     }
     catch (const sdbusplus::exception_t& e)
     {
-        log<level::ERR>(fmt::format("D-Bus call exception, OBJPATH({}), "
+        log<level::ERR>(std::format("D-Bus call exception, OBJPATH({}), "
                                     "INTERFACE({}), PROPERTY({}) EXCEPTION({})",
                                     objPath, intf, state, e.what())
                             .c_str());
@@ -224,7 +224,7 @@
     catch (const std::bad_variant_access& e)
     {
         log<level::ERR>(
-            fmt::format("Exception raised while read host state({}) property "
+            std::format("Exception raised while read host state({}) property "
                         "value,  OBJPATH({}), INTERFACE({}), EXCEPTION({})",
                         state, objPath, intf, e.what())
                 .c_str());
