C++ header-only

Open-source C++ projects categorized as header-only
CPP Cpp17 Cpp20 Cpp11 C++

Top 23 C++ header-only Projects

header-only
  1. json

    JSON for Modern C++

    Project mention: Fighting with json - a war story | dev.to | 2026-02-05
  2. SaaSHub

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

    SaaSHub logo
  3. spdlog

    Fast C++ logging library.

    Project mention: Asynchronous backend on modern C++ 23. | dev.to | 2025-12-24

    ulog – logger inspired by spdlog build on top of uvent. Instead of using own thread spawns flushing coroutine.

  4. cpp-httplib

    A C++ header-only HTTP/HTTPS server and client library

  5. entt

    Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more

    Project mention: EnTT | news.ycombinator.com | 2026-05-10
  6. GLM

    OpenGL Mathematics (GLM)

    Project mention: Learning OpenGL Part: The End - Model loading | dev.to | 2025-10-26
  7. FTXUI

    Features: - Functional style. Inspired by [1] and React - Simple and elegant syntax (in my opinion). - Support for UTF8 and fullwidth chars (→ 测试). - No dependencies. - Cross platform. Linux/mac (main target), Windows (experimental thanks to contributors), - WebAssembly. - Keyboard & mouse navigation. Operating systems: - linux emscripten - linux gcc - linux clang - windows msvc - mac clang

    Project mention: Why I Built a C++ Linux System Monitor (And Why You Should Too) | dev.to | 2025-10-17

    Built with FTXUI for the terminal interface

  8. GuiLite

    ✔️The smallest header-only GUI library(4 KLOC) for all platforms

  9. Crow

    Crow is very fast and easy to use C++ micro web framework (inspired by Python Flask)

  10. doctest

    The fastest feature-rich C++11/14/17/20/23 single-header testing framework

    Project mention: Doctest is a new C++ testing framework | news.ycombinator.com | 2025-07-09
  11. Magic Enum C++

    Static reflection for enums (to string, from string, iteration) for modern C++, work with any enum type without any macro or boilerplate code

    Project mention: Magic Enum C++: Header-only C++17 library provides static reflection for enums | news.ycombinator.com | 2026-06-04
  12. Crow

    A Fast and Easy to use microframework for the web. (by CrowCpp)

    Project mention: How I deployed my first project for my devops portfolio: Project Architecture | dev.to | 2025-07-19

    This project (Github branch main) I built this app entirely in CPP and I used the CrowCpp framework to run it.

  13. compile-time-regular-expressions

    Compile Time Regular Expression in C++

    Project mention: Is Rust faster than C? | news.ycombinator.com | 2026-01-14

    Other examples are CTRE (https://github.com/hanickadot/compile-time-regular-expressio...) and format string compilation (https://fmt.dev/12.0/api/#compile-api). The closest C counterpart is re2c which also requires external tooling.

  14. argparse

    Argument Parser for Modern C++

    Project mention: Scripts I wrote that I use all the time | news.ycombinator.com | 2025-10-22

    Regarding other ports, I've also been pretty happy with https://github.com/nodeca/argparse, which works nicely from Typescript. Looks like it hasn't been updated for a while, but it's not like there's a great deal wrong with it.

    https://github.com/p-ranav/argparse is a single-file argparse for Modern C++, which means it's typically straightforward, if baffling in places and a bit annoying to step through in the debugger.

    The nice thing about the argparse ports is that provided they take their job seriously, your programs will all end up with a vaguely consistent command line UX in terms of longopt syntax, and, importantly, a --help page.

  15. indicators

    Activity Indicators for Modern C++

  16. glaze

    Extremely fast, in memory, serialization, reflection, and RPC library for C++. JSON, BEVE, BSON, CBOR, CSV, JSONB, MessagePack, TOML, YAML, EETF

    Project mention: Glaze: Fast JSON with built-in HTTP Server for modern C++ | news.ycombinator.com | 2025-09-09
  17. plog

    Portable, simple and extensible C++ logging library

  18. Nameof C++

    Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum

  19. cppzmq

    Header-only C++ binding for libzmq

  20. FunctionalPlus

    Functional Programming Library for C++. Write concise and readable C++ code.

  21. palanteer

    Visual Python and C++ nanosecond profiler, logger, tests enabler

  22. PEGTL

    Parsing Expression Grammar Template Library

    Project mention: Parsing Expression Grammar Template Library | news.ycombinator.com | 2025-06-24
  23. tomlplusplus

    Header-only TOML config file parser and serializer for C++17.

    Project mention: OSD600 Lab 4 | dev.to | 2025-10-03

    I found that this repository had no pull request yet so I contacted the owner to get permission to work on it after filing an issue, then I got to work researching how to approach this using C++. My C++ is rusty, so it took me some time to work my way through the code. Finally, with a little research, I worked out that I could use the existing CMake file in this project to set up the tomlplusplus implementation which would allow me to parse a config.toml file and load default options into the tool. I added a new function, loadFromConfig, that reads the TOML file and populates the CLI options struct with values like output, include, exclude, and recent. This way, users can define their preferences once and avoid repeating long command-line arguments.

  24. uvw

    Header-only, event based, tiny and easy to use libuv wrapper in modern C++ - now available as also shared/static library!

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++ header-only discussion

Log in or Post with

C++ header-only related posts

  • ConjureEnum: lightweight header-only C++20 enum and typename reflection

    1 project | news.ycombinator.com | 4 Jun 2026
  • Rewriting a FIX Engine in C++23: What Got Simpler (and What Didn't)

    1 project | dev.to | 19 May 2026
  • EnTT

    1 project | news.ycombinator.com | 10 May 2026
  • Rewriting a FIX Engine in C++23: What Got Simpler (and What Didn't)

    1 project | dev.to | 31 Mar 2026
  • What Happens When You Port a 2001 C++ Library to C++20

    1 project | dev.to | 27 Mar 2026
  • NexusFix: Zero-alloc compile-time hardened FIX engine for sub-100ns execution

    1 project | news.ycombinator.com | 25 Mar 2026
  • Show HN: Woid – 3x Faster Runtime Polymorphism. C++23

    2 projects | news.ycombinator.com | 12 Jan 2026
  • A note from our sponsor - SaaSHub
    www.saashub.com | 13 Jun 2026
    SaaSHub helps you find the best software and product alternatives Learn more →

Index

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

# Project Stars
1 json 49,920
2 spdlog 28,906
3 cpp-httplib 16,557
4 entt 12,789
5 GLM 11,007
6 FTXUI 10,251
7 GuiLite 7,746
8 Crow 7,629
9 doctest 6,760
10 Magic Enum C++ 6,103
11 Crow 4,878
12 compile-time-regular-expressions 3,811
13 argparse 3,441
14 indicators 3,391
15 glaze 2,835
16 plog 2,544
17 Nameof C++ 2,320
18 cppzmq 2,306
19 FunctionalPlus 2,288
20 palanteer 2,210
21 PEGTL 2,135
22 tomlplusplus 2,074
23 uvw 2,044

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?