header-only

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

Top 23 header-only Open-Source Projects

header-only
  1. json

    JSON for Modern C++

    Project mention: πŸš€ Zyn: Modern C++ Project Management Made Effortless | dev.to | 2025-05-17

    [dependencies] json = { git = "https://github.com/nlohmann/json.git", tag = "v3.11.2" }

  2. InfluxDB

    InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.

    InfluxDB logo
  3. spdlog

    Fast C++ logging library.

    Project mention: πŸš€ Zyn 1.0.2 Released β€” Smarter Builds, Powerful Debugging, Cleaner Workflow | dev.to | 2025-05-11

    πŸ“¦ Add Dependencies with zyn add You can now easily add Git-based dependencies to your project using a simple command: zyn add https://github.com/gabime/spdlog

  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

  6. nuklear

    A single-header ANSI C immediate mode cross-platform GUI library (by Immediate-Mode-UI)

    Project mention: RGFW: Single-header C99 window abstraction library | news.ycombinator.com | 2024-11-22

    The one big downside I see is that if you want to actually work on the library itself, it's a pain to have to re-compile the entire thing every time you change something.

    Nuklear (https://github.com/Immediate-Mode-UI/Nuklear) uses separate files with a deploy script that combines them all into a single header; I think that approach is quicker for iterating on the code.

  7. GLM

    OpenGL Mathematics (GLM)

    Project mention: New Year, New Game Engine - Nikola Engine Devlog 0 | dev.to | 2025-02-26

    As for math, that was the easiest choice as of yet. No doubt, GLM is a "gold standard" at this point. For OpenGL it is, at least. But, like with a lot of the other APIs, I decided to build a wrapper around it rather than directly reference the library in the engine's code. And for physics, well, I had not come upon that answer just yet. I did try to make my own physics logic at some point. And while it was, surprisingly, successful, I wanted more than just a simple physics layer. I wanted something more complex and, more importantly, faster than my implementation. I have not decided upon a physics library yet. But I'll cross that bridge when I come to it.

  8. 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: Introducing TUISIC: TUI Music Streaming App. | dev.to | 2025-01-19

    But then i'm an engineer and doing things in organize manner is what i am supposed to do. And one day i came to this repo FXTUI a fantastic C++ library for creating terminal user interfaces, so i started building tuisic.

  9. SaaSHub

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

    SaaSHub logo
  10. Crow

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

  11. GuiLite

    βœ”οΈThe smallest header-only GUI library(4 KLOC) for all platforms

  12. doctest

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

    Project mention: The Two Factions of C++ | news.ycombinator.com | 2024-11-24

    catch2 has become fairly bloated. doctest takes all of the best parts of catch2 without all the bloat and the end result is a test framework that is literally over 10x faster than catch2. It's also like 90% compatible with catch2 so porting your tests to it is pretty easy.

    Especially if you have a build process that always runs your unit tests, it's nice to have a very fast test/compile/debug loop.

    https://github.com/doctest/doctest

  13. 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

  14. Crow

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

  15. awesome-hpp

    A curated list of awesome header-only C++ libraries

  16. compile-time-regular-expressions

    Compile Time Regular Expression in C++

    Project mention: Show HN: Less Slow C++ | news.ycombinator.com | 2025-04-18

    The problem can occur in general if there is a greedy match within the regex: https://github.com/hanickadot/compile-time-regular-expressio...

    Although it looks like that this got fixed for simple patterns.

  17. indicators

    Activity Indicators for Modern C++

  18. argparse

    Argument Parser for Modern C++

  19. proxy

    Proxy: Next Generation Polymorphism in C++ (by microsoft)

  20. plog

    Portable, simple and extensible C++ logging library

  21. cmake-init

    The missing CMake project initializer

    Project mention: CMake-init – The missing CMake project initializer | news.ycombinator.com | 2024-07-16
  22. FunctionalPlus

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

  23. Nameof C++

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

  24. palanteer

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

  25. cppzmq

    Header-only C++ binding for libzmq

  26. SaaSHub

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

    SaaSHub logo
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).

header-only discussion

Log in or Post with

header-only related posts

  • πŸš€ Zyn 1.0.2 Released β€” Smarter Builds, Powerful Debugging, Cleaner Workflow

    1 project | dev.to | 11 May 2025
  • Show HN: Hexi, modern header-only network binary serialisation for C++ hackers

    3 projects | news.ycombinator.com | 28 Mar 2025
  • Abusing C to Implement JSON Parsing with Struct Methods

    4 projects | news.ycombinator.com | 1 Mar 2025
  • Starting Up The Engine - Nikola Game Engine Devlog 1

    3 projects | dev.to | 28 Feb 2025
  • Making a performant audio capture systemβš‘πŸš€πŸ’¨

    3 projects | dev.to | 19 Feb 2025
  • C: Simple Defer, Ready to Use

    4 projects | news.ycombinator.com | 6 Jan 2025
  • Implementing Regular Expressions in TypeScript Types (Badly)

    3 projects | news.ycombinator.com | 20 Oct 2024
  • A note from our sponsor - InfluxDB
    www.influxdata.com | 24 May 2025
    InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now. Learn more β†’

Index

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

# Project Stars
1 json 45,756
2 spdlog 26,201
3 cpp-httplib 14,327
4 entt 11,060
5 nuklear 9,978
6 GLM 9,902
7 FTXUI 8,230
8 Crow 7,595
9 GuiLite 7,482
10 doctest 6,218
11 Magic Enum C++ 5,432
12 Crow 3,885
13 awesome-hpp 3,732
14 compile-time-regular-expressions 3,551
15 indicators 3,183
16 argparse 3,058
17 proxy 2,649
18 plog 2,330
19 cmake-init 2,304
20 FunctionalPlus 2,190
21 Nameof C++ 2,190
22 palanteer 2,138
23 cppzmq 2,107

Sponsored
InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com

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