C++ single-header

Open-source C++ projects categorized as single-header

Top 20 C++ single-header Projects

single-header
  1. indicators

    Activity Indicators for Modern C++

  2. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  3. tabulate

    Table Maker for Modern C++ (by p-ranav)

  4. cr

    cr.h: A Simple C Hot Reload Header-only Library

    Project mention: Making Video Games in 2025 (without an engine) | news.ycombinator.com | 2026-03-02

    I see `dotnet watch` being mentioned for code hot reload which is such a great feature for quickly iterating on a game. Not having to restart the whole game just because one has changed a few if statements and values really helps staying in the flow.

    But I'm still not too enthusiastic about having GC in C# which is why ideally I'd like to start making a small 2D game just with SDL3 and C++ but how could I get this nice hot reload workflow there? I don't have the money to pay for expensive proprietary tools like https://liveplusplus.tech so what can I do? I guess there's the "game as dynamic library" trick from Handmade Hero (see https://www.youtube.com/shorts/seWAIURXxH0) so maybe that would work good enough? Maybe https://github.com/fungos/cr would do most of what's needed here?

    Also, how does one even do modern C++ these days? Is it possible to have big C++ code bases that still compile fast these days? Is CMake 4 good™ now? Are modules really there yet? I rely on clangd as LSP for working with C++ but I read that clangd still fundamentally struggles with C++ modules https://chuanqixu9.github.io/c++/2025/12/03/Clangd-support-f... and it's so bad that there has even been some effort going into making a new C++ LSP https://github.com/clice-io/clice

  5. nanobench

    Simple, fast, accurate single-header microbenchmarking functionality for C++11/14/17/20

  6. watcher

    Filesystem watcher. Works anywhere. Simple, efficient and friendly. (by e-dant)

    Project mention: Detecting file changes on macOS with kqueue | news.ycombinator.com | 2026-03-28

    Since there are comments below asking about benchmarks, others noting or expressing interest in other projects, I'll drop the one I made: https://github.com/e-dant/watcher

    There are benchmarks in there, and comparisons with all the other watchers out there I could find at the time I made it (see "Comparison with Similar Projects" at the very bottom of the readme).

  7. matchit.cpp

    match(it): A lightweight single-header pattern-matching library for C++17 with macro-free APIs.

  8. csv2

    Fast CSV parser and writer for Modern C++

  9. leaf

    Lightweight Error Augmentation Framework (by boostorg)

  10. itoa

    Fast integer to ascii / integer to string conversion (by jeaiii)

  11. x86RetSpoof

    Invoke functions with a spoofed return address. For 32-bit Windows binaries. Supports __fastcall, __thiscall, __stdcall and __cdecl calling conventions. Written in C++17.

  12. fkYAML

    A C++ header-only YAML library

  13. meta.hpp

    C++20 Dynamic Reflection Library

  14. ramen

    Real-time Actor-based Message Exchange Network 🍜

  15. Heady

    A utility for creating amalgamated single-header C++ libraries

  16. Tachyon.JSON

    Discontinued Tachyon JSON v6: The World's Fastest JSON Library. 5.5 GB/s throughput via AVX2 ASM kernels & Lazy Indexing. C++20 header-only, nlohmann-like syntax, 160x faster than standard DOM parsers. [GET https://api.github.com/repos/wilkolbrzym-coder/Tachyon.JSON: 404 - Not Found // See: https://docs.github.com/rest/repos/repos#get-a-repository]

    Project mention: Show HN: Tachyon – A C++ JSON parser matching simdjson's throughput via AVX-512 | news.ycombinator.com | 2026-01-08
  17. curl4cpp

    Single header cURL wrapper for C++ around libcURL

  18. iface

    Anonymous, non-intrusive interfaces in C++

  19. Conex

    C++ single-header library for condition-based binary pattern matching. (by DanielCohen197)

    Project mention: Conex – single-header C++20 library for condition-based binary pattern matching | news.ycombinator.com | 2026-05-20
  20. command

    Command, ::process::Command like syscalls in C++. (by ferhatgec)

  21. EventSystem

    a single header event system that im using in my game

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020).

C++ single-header discussion

Log in or Post with

C++ single-header related posts

  • how do you properly benchmark?

    2 projects | /r/cpp | 20 Feb 2023
  • Much Faster than std::string, fmt::format, std::to_chars, std::time and more?

    1 project | /r/cpp | 6 Oct 2022
  • I don’t know which container to use (and at this point I’m too afraid to ask)

    2 projects | /r/cpp | 3 Feb 2022
  • C++20 std::format is 2x slower than std::fstream?

    13 projects | /r/cpp_questions | 19 Nov 2021
  • Nanobench: Fast, single-header microbenchmarking functionality for C++

    1 project | news.ycombinator.com | 9 Nov 2021
  • Curl4cpp – single header C++ cURL wrapper around libcURL

    1 project | news.ycombinator.com | 1 Aug 2021
  • curl4cpp - single header c++ cURL wrapper around libcURL

    1 project | /r/linux | 31 Jul 2021
  • A note from our sponsor - SaaSHub
    www.saashub.com | 12 Jun 2026
    SaaSHub helps you find the best software and product alternatives Learn more →

Index

What are some of the best open-source single-header projects in C++? This list will help you:

# Project Stars
1 indicators 3,391
2 tabulate 2,163
3 cr 1,747
4 nanobench 1,680
5 watcher 796
6 matchit.cpp 644
7 csv2 619
8 leaf 339
9 itoa 245
10 x86RetSpoof 179
11 fkYAML 143
12 meta.hpp 139
13 ramen 73
14 Heady 63
15 Tachyon.JSON 13
16 curl4cpp 13
17 iface 6
18 Conex 3
19 command 3
20 EventSystem 1

Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com

Did you know that C++ is
the 7th most popular programming language
based on number of references?