TrendWhat rose on GitHub, every day at 07:30 KST · 한국어

GitHub · as of November 8, 2026 · View on GitHub →

fmtlib/fmt

C++ string formatting library

+13 stars in 7 days

Format C++ text quickly and safely

Converting variable values to strings can become a bottleneck when logging or saving data to files. This library handles that task faster than the C++ standard library's output features. It implements the C++20 std::format and C++23 std::print standards in advance, allowing you to use consistent formatting without waiting for the latest standards.

Early implementation of standard formatting

This library provides the std::format and std::print features included in the C++20 and C++23 standards before the compilers do. This allows you to compose strings using syntax similar to Python's format method, even if your compiler does not yet support the standard. You can specify values by index using positional arguments when localization is required. This feature provides a more intuitive syntax than C's printf or C++'s iostream.

Accuracy and speed of number conversion

Accuracy and speed are most important when converting floating-point numbers to strings. This library uses the Dragonbox algorithm to convert IEEE 754 floating-point values. This method guarantees correct rounding, the shortest possible result string, and that converting the result back to a number matches the original value. It is tens of percent to 20 to 30 times faster than sprintf or iostream, with the difference being particularly large in number formatting. It minimizes dynamic memory allocation and provides an option to compile format strings into efficient code.

Compile-time safety

Errors in format strings are detected at the compilation stage. For example, if you use a number-only format spec on a string variable, the compiler reports an error. This prevents buffer overflows from occurring at runtime. The library has complete type safety and reduces the risk of memory leaks or overflows through automatic memory management. It maintains stability through extensive testing and continuous fuzzing.

Scope of use and extensibility

In addition to basic string formatting, it supports dates and times, containers, and colored text output. Including fmt/chrono.h allows you to print std::chrono objects directly, and using fmt/ranges.h prints containers like vectors in the form [1, 2, 3]. Using fmt/color.h lets you apply text styles such as color, bold, and underline in the terminal. Custom types can be easily integrated into formatting, offering good extensibility. The minimal configuration consists of three files: core.h, format.h, and format-inl.h, keeping the code size small.

Considerations before adoption

This library uses the MIT license and has no external dependencies. If you want a header-only configuration, define the FMT_HEADER_ONLY macro. When comparing compile time and binary size, building as a module can reduce compile time by 27% in optimized builds. Measurements in an Apple M5 Max environment show that compile time is similar to or shorter than printf, and binary size is similar to or smaller. When introducing it to an existing project, you must check C++ standard version and compiler compatibility, especially since the compile-time check feature only works fully with C++20 or later.

Written by AI from this repository's README on September 26, 2026. For the facts, the original on GitHub is the reference.

By the numbers

GitHub trending history
12 days between Jun 19, when Trend began recording, and Nov 8, 2026 · first on Sep 2 · best daily rank #1 (Sep 2)

Read from GitHub, as of November 8, 2026.

Language
C++
Topics
c-plus-plus · chrono · cpp · cross-platform · floating-point · formatting · multiplatform · output
Stars
25,914
Stars gained in 7 days
+13
Contributors
658
Forks
3,095
Latest release
12.2.1 · November 7, 2026
Commits
8,087
Last commit
November 8, 2026
Open issues
4
Open pull requests
5

View on GitHub → · Homepage

README badge

trend.ondo.sh · GitHub daily trending #1 · September 2, 2026

The badge above shows the highest this repository has ranked on GitHub's daily trending since June 19, 2026, and the day it did. Paste the Markdown below into your README. The badge opens this page.

[![trend.ondo.sh](https://trend.ondo.sh/github/r/fmtlib--fmt/badge.en.svg)](https://trend.ondo.sh/github/r/fmtlib--fmt/en.html)