C header-only

Open-source C projects categorized as header-only

Top 23 C header-only Projects

header-only
  1. nuklear

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

    Project mention: Nuklear: A minimal-state, immediate-mode graphical user interface toolkit | news.ycombinator.com | 2025-09-23
  2. SaaSHub

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

    SaaSHub logo
  3. pocketpy

    Portable Python 3.x Interpreter in Modern C for Game Scripting

  4. librg

    🚀 Making multi-player gamedev simpler since 2017

  5. metalang99

    Full-blown preprocessor metaprogramming

    Project mention: Recursive macros in C, demystified (once the ugly crying stops) | news.ycombinator.com | 2025-11-05

    The CPP does allow quite advanced metaprogramming, it's just so obtuse to use and requires insane hacks so almost nobody does. See one of my favorite projects https://github.com/hirrolot/metalang99

  6. zpl

    📐 Pushing the boundaries of simplicity

  7. earcut.hpp

    Fast, header-only polygon triangulation

    Project mention: Earcut64: Zero-Allocation Triangulation for Tiny Polygons | dev.to | 2025-06-16

    Earcut is almost a teaching example: pick any non-self-intersecting polygon, find an "ear" (three consecutive vertices that form an empty inner triangle), cut it off, repeat. Simple? Yes. Slow? Sometimes. But on contours with few points Earcut can be the fastest tool in the shed, as my benchmarks against iTriangle and Mapbox implementations have shown.

  8. minicoro

    Single header stackful cross-platform coroutine library in pure C.

    Project mention: Minicoro: Single header stackful cross-platform coroutine library in pure C | news.ycombinator.com | 2025-11-14
  9. rawdraw

    Primitive Platform Agnostic Windowing+Input Header-Only Library

  10. Tina

    Tina is a teeny tiny, header only, coroutine and job library.

  11. ctl

    My variant of the C Template Library (by rurban)

  12. tiny-dream

    Tiny Dream - An embedded, Header Only, Stable Diffusion C++ implementation

  13. RSGL

    A simple-to-use modular, cross-platform graphics library. It combines the freedom of lower-level graphics libraries with modern C techniques, offering both simplicity and convenience.

  14. libcester

    A robust header-only unit testing framework for C and C++ programming language. Support function mocking, memory leak detection, crash report.

  15. TurboStitchGIF-HeaderOnly-Fast-ZeroAllocation-PlatformIndependent-Embedded-C-GIF-Decoder

    TurboStitchGIF: A fast, header-only C GIF decoder without dynamic allocations, ideal for embedded systems and cross-platform projects.

    Project mention: Show HN: TurboStitchGIF GIF decoder that lets you choose: safety or speed | news.ycombinator.com | 2026-02-22

    Version 1.2 introduces two LZW backends (safe bounds-checked vs unsafe turbo), micro-cache for 30-40% faster decoding, three output formats (RGB888/RGB565LE/RGBA8888), span-based turbo blit, optional 256KB RGB565 map2 for 2-pixel-at-once rendering, proper disposal method 3 support, renderer API for indexed output, safety toggles to disable checks when you need raw speed, and prefix mode to avoid symbol conflicts — all while staying 100% malloc-free on a user-provided scratch buffer.

    Repo: https://github.com/Ferki-git-creator/TurboStitchGIF-HeaderOn...

  16. sgc

    Generic Algorithms and Data Structures in C

  17. rexo

    Neat single-file cross-platform unit testing framework for C/C++.

  18. OpenCSTL

    Drop-in C++ STL for C — same push_back, insert, begin/end. Header-only.

    Project mention: Implementing C++ STL containers in pure C — what I learned | dev.to | 2026-04-08

    Source is here if anyone wants to look at the macro internals: https://github.com/springkim/OpenCSTL

  19. pega-texto

    Single-file Parsing Expression Grammars (PEG) runtime engine for C

  20. exile.h

    Painless Linux sandboxing API

  21. Mathc

    A simple and clean, glsl like, math (linear algebra) header only library for C.

  22. c-flags

    Library for parsing command line arguments easily. Like golang flag module.

  23. Canon-C

    A semantic standard library for verified C — explicit, composable modules that add meaning without hiding behavior.

    Project mention: Show HN: Canon-C – a semantic C library | news.ycombinator.com | 2026-02-09
  24. PoxHash

    A block hashing algorithm with implementations in C, Rust, Go, Nim, Python and JS

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

  • Canvas_ity: A tiny, single-header <canvas>-like 2D rasterizer for C++

    6 projects | news.ycombinator.com | 21 Feb 2026
  • Ask HN: What are you working on this weekend?

    3 projects | news.ycombinator.com | 9 Aug 2025
  • Starting Up The Engine - Nikola Game Engine Devlog 1

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

    4 projects | news.ycombinator.com | 6 Jan 2025
  • Using Jolt with flecs & Dear ImGui: Game Physics Introspection

    4 projects | dev.to | 17 Apr 2024
  • Factor is faster than Zig

    11 projects | news.ycombinator.com | 10 Nov 2023
  • Tiny Dream – An Embedded, Header Only, Stable Diffusion C++ Implementation

    1 project | news.ycombinator.com | 26 Sep 2023
  • A note from our sponsor - SaaSHub
    www.saashub.com | 15 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 nuklear 11,205
2 pocketpy 2,073
3 librg 1,481
4 metalang99 1,069
5 zpl 1,062
6 earcut.hpp 992
7 minicoro 934
8 rawdraw 475
9 Tina 298
10 ctl 287
11 tiny-dream 265
12 RSGL 198
13 libcester 66
14 TurboStitchGIF-HeaderOnly-Fast-ZeroAllocation-PlatformIndependent-Embedded-C-GIF-Decoder 49
15 sgc 37
16 rexo 31
17 OpenCSTL 26
18 pega-texto 18
19 exile.h 18
20 Mathc 16
21 c-flags 12
22 Canon-C 12
23 PoxHash 8

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 6th most popular programming language
based on number of references?