diff --git a/chassis_state_manager.cpp b/chassis_state_manager.cpp
index bfa8ff8..189f2de 100644
--- a/chassis_state_manager.cpp
+++ b/chassis_state_manager.cpp
@@ -6,9 +6,6 @@
 #include "xyz/openbmc_project/Common/error.hpp"
 #include "xyz/openbmc_project/State/Shutdown/Power/error.hpp"
 
-#include <fmt/format.h>
-#include <fmt/printf.h>
-
 #include <cereal/archives/json.hpp>
 #include <org/freedesktop/UPower/Device/client.hpp>
 #include <phosphor-logging/elog-errors.hpp>
@@ -22,6 +19,7 @@
 #include <xyz/openbmc_project/State/Decorator/PowerSystemInputs/server.hpp>
 
 #include <filesystem>
+#include <format>
 #include <fstream>
 
 namespace phosphor
@@ -76,10 +74,10 @@
 {
     systemdTargetTable = {
         // Use the hard off target to ensure we shutdown immediately
-        {Transition::Off, fmt::format(CHASSIS_STATE_HARD_POWEROFF_TGT_FMT, id)},
-        {Transition::On, fmt::format(CHASSIS_STATE_POWERON_TGT_FMT, id)},
+        {Transition::Off, std::format(CHASSIS_STATE_HARD_POWEROFF_TGT_FMT, id)},
+        {Transition::On, std::format(CHASSIS_STATE_POWERON_TGT_FMT, id)},
         {Transition::PowerCycle,
-         fmt::format(CHASSIS_STATE_POWERCYCLE_TGT_FMT, id)}};
+         std::format(CHASSIS_STATE_POWERCYCLE_TGT_FMT, id)}};
 }
 
 // TODO - Will be rewritten once sdbusplus client bindings are in place
@@ -98,7 +96,7 @@
     powerSysInputsPropChangeSignal = std::make_unique<sdbusplus::bus::match_t>(
         bus,
         sdbusplus::bus::match::rules::propertiesChangedNamespace(
-            fmt::format(
+            std::format(
                 "/xyz/openbmc_project/power/power_supplies/chassis{}/psus", id),
             decoratorServer::PowerSystemInputs::interface),
         [this](auto& msg) { this->powerSysInputsChangeEvent(msg); });
@@ -142,12 +140,12 @@
 
                     // Reset host sensors since system is off now
                     // Ensure Power Leds are off.
-                    startUnit(fmt::format(CHASSIS_BLACKOUT_TGT_FMT, id));
+                    startUnit(std::format(CHASSIS_BLACKOUT_TGT_FMT, id));
 
                     setStateChangeTime();
                     // Generate file indicating AC loss occurred
                     std::string chassisLostPowerFileFmt =
-                        fmt::sprintf(CHASSIS_LOST_POWER_FILE, id);
+                        std::format(CHASSIS_LOST_POWER_FILE, id);
                     fs::create_directories(BASE_FILE_DIR);
                     fs::path chassisPowerLossFile{chassisLostPowerFileFmt};
                     std::ofstream outfile(chassisPowerLossFile);
@@ -222,7 +220,7 @@
             info("power status transitioned from {START_PWR_STATE} to Good and "
                  "chassis power is off, calling APR",
                  "START_PWR_STATE", initialPowerStatus);
-            restartUnit(fmt::format(AUTO_POWER_RESTORE_SVC_FMT, this->id));
+            restartUnit(std::format(AUTO_POWER_RESTORE_SVC_FMT, this->id));
         }
     }
 }
@@ -556,7 +554,7 @@
         return 0;
     }
 
-    if ((newStateUnit == fmt::format(CHASSIS_STATE_POWEROFF_TGT_FMT, id)) &&
+    if ((newStateUnit == std::format(CHASSIS_STATE_POWEROFF_TGT_FMT, id)) &&
         (newStateResult == "done") &&
         (!stateActive(systemdTargetTable[Transition::On])))
     {
@@ -577,13 +575,10 @@
         // This file is used to indicate to chassis related systemd services
         // that the chassis is already on and they should skip running.
         // Once the chassis state is back to on we can clear this file.
-        auto size = std::snprintf(nullptr, 0, CHASSIS_ON_FILE, 0);
-        size++; // null
-        std::unique_ptr<char[]> chassisFile(new char[size]);
-        std::snprintf(chassisFile.get(), size, CHASSIS_ON_FILE, 0);
-        if (std::filesystem::exists(chassisFile.get()))
+        auto chassisFile = std::format(CHASSIS_ON_FILE, 0);
+        if (std::filesystem::exists(chassisFile))
         {
-            std::filesystem::remove(chassisFile.get());
+            std::filesystem::remove(chassisFile);
         }
     }
 
@@ -654,7 +649,7 @@
 
 fs::path Chassis::serializePOH()
 {
-    fs::path path{fmt::format(POH_COUNTER_PERSIST_PATH, id)};
+    fs::path path{std::format(POH_COUNTER_PERSIST_PATH, id)};
     std::ofstream os(path.c_str(), std::ios::binary);
     cereal::JSONOutputArchive oarchive(os);
     oarchive(pohCounter());
@@ -663,7 +658,7 @@
 
 bool Chassis::deserializePOH(uint32_t& pohCounter)
 {
-    fs::path path{fmt::format(POH_COUNTER_PERSIST_PATH, id)};
+    fs::path path{std::format(POH_COUNTER_PERSIST_PATH, id)};
     try
     {
         if (fs::exists(path))
@@ -710,7 +705,7 @@
 
 void Chassis::serializeStateChangeTime()
 {
-    fs::path path{fmt::format(CHASSIS_STATE_CHANGE_PERSIST_PATH, id)};
+    fs::path path{std::format(CHASSIS_STATE_CHANGE_PERSIST_PATH, id)};
     std::ofstream os(path.c_str(), std::ios::binary);
     cereal::JSONOutputArchive oarchive(os);
 
@@ -720,7 +715,7 @@
 
 bool Chassis::deserializeStateChangeTime(uint64_t& time, PowerState& state)
 {
-    fs::path path{fmt::format(CHASSIS_STATE_CHANGE_PERSIST_PATH, id)};
+    fs::path path{std::format(CHASSIS_STATE_CHANGE_PERSIST_PATH, id)};
 
     try
     {
