GitHub - r-lyeh/single_file_libs: List of single-file C/C++ libraries, with emphasis on clause-less licenses.

r-lyeh

C/C++ open-source libraries with minimal dependencies

Generally, the following is a list of small, easy-to-integrate, portable libraries which are usable from C and/or C++, and should be able to be compiled on both 32-bit and 64-bit platforms. There is preference for libraries that are C, public domain and single-file. However, we have not personally verified that any specific library is as advertised, or is quality software.

New libraries and corrections

We accept submissions for new libraries and corrections if information for a library below is wrong. Consider either opening a Pull Request, a new Issue or drop a message in our discord channel:

https://discord.gg/2fZVEym

The server is meant to be a pleasant space to chat about C, C++, Libs authoring and Game development specifically.

Rules

Libraries must be usable from C or C++, ideally both.

Libraries must include the licensing terms in the header and source files.

Libraries should be usable from more than one platform (ideally, all major desktops and/or all major mobile).

Libraries should compile and work on both 32-bit and 64-bit platforms.

Libraries should use at most two files (one header, one source): more than two files are mostly forbidden.

Exceptions will be allowed for good reasons.

Other lists

Also you might be interested in other related, but different lists:

STB

: the mighty collection of gamedev utils.

clib

: list of (mostly) small single C functions (licenses not listed)

CCAN

: package of lots of shareable C functions (mixed licenses)

And some more:

andrewwillmott

,

b-library (C,C++)

,

blastbay

,

chobo-shl (C++)

,

clibs

,

containers (C++)

,

cpp-poc (C++)

,

cute_headers (C,C++)

,

data-structures-c

,

dr_libs

,

dyeo.h

,

emilib (C++)

,

final_game_tech (C,C++)

,

ftg_toolbox_public

,

gb

,

gl-helpers (C,C++)

,

ijhandlealloc

,

jar

,

jo

,

kj

,

klib

,

kokke

,

libjrc

,

libs

,

libs

,

live_edit

,

maratis

,

minilibs

,

miscsrc

,

mmx

,

nflibs

,

noc

,

ok-fm

,

ok-lib

,

par

,

pico_headers

,

portable-snippets

,

px (C++)

,

rjm

,

rxi

,

shadertoolkit

,

single-header-file-c-libs

,

skeeto

,

slibs

,

snippets

,

snippets

,

sokol

,

statvs (C++)

,

sts

,

sweet (C++)

,

tinybits (C,C++)

,

tm

,

utl (C++)

,

yocto-gl (C++)

,

zero

,

zeroTolerance

,

zheaders

,

zpl

,

Main listing

Single-header C files with clause-less licenses are highlighted.

taglibrarydescription"misc"

TinyRISCV64

(1 C++, MIT)RISC-V RV64IM Virtual Machine2d

Blendish

(1 C, MIT)Blender-style widget rendering using NanoVG2d

C-Turtle

(1 C++, MIT)Port of Python's Turtle to C++2d

Cgl

(2 C, MIT)C Game Library2d

Cimg

(1 C++, CeCILL)Image processing toolkit (60K LoC)2d

Colourblind

(1 C, ISC)Simulating colourblindness2d

Daisy

(1 C++, MIT)2D Graphics and text2d

GlyType

(1, C, WTFPL2)Ultra lightweight font renderer2d

Immediate2D

(2 C++, PD)Zero-configuration, immediate-mode 2D graphics for Windows2d

M_image.h

(1 C, ZLIB)Image processing routines2d

RFont

(1 C, ZLIB)Simple-to-use lightweight single header modular font rendering library2d

RGL

(1 C, ZLIB)Simple ultra-lightweight OpenGL version abstraction based on RLGL (pipeline system)2d

Scalable-font2

(1 C, MIT)Scalable Font renderer + specification2d

Si_normalmap

(1 C, PD)Image to Normal Map generator2d

Tigr

(2 C, PD)Windowing, text and graphics for Windows, Linux and macOS2d

Wfc

(1 C, MIT)Generate image locally similar to the input image using WFC algorithm3d

Debug-draw

(1 C++, PD)API-agnostic immediate-mode debug rendering3d

Lightmapper

(1 C, PD)Use your OpenGL renderer to offline bake lightmaps3d

Mikktspace

(2 C, ZLIB)Compute tangent space for normal mapping3d

Model3d

(1 C, MIT)3D model format specification3d

Seamoptimizer

(1 C, PD)Modify lightmap data to hide seams3d

Simple OpenGL Loader

(1 C, MIT)Extensible, cross-platform OpenGL loader3d

Small3dlib

(1 C, CC0)Fast and portable software renderer3d

Stb_voxel_render

(1 C, PD)Minecraft-esque voxel rendering "engine" with many more features3d

Swarmz

(1 C++, PD)Swarming/flocking algorithm3d

Tinygizmo

(2 C++, PD)Gizmo objects for interactively editing 3d transformations3d

Vertex Cache Optimizer

(1 C, PD)Vertex cache optimization of meshes3d

Vulkan Memory Allocator

(1 C, MIT)Memory allocator for Vulkan3d

ZLight

(1 C, ZLIB)Software rendering with depth, light and shadowai

Genann

(2 C, ZLIB)Simple neural networks (ANN)ai

KANN

(2 C, MIT)Automatic differentiation (2 files)app

RGFW

(1 C, ZLIB)A multi-platform single-header user-friendly GUI framework as an alternative to GLFWargv

Argh!

(1 C++, BSD)Command-line argument parsingargv

Clara

(1 C++, BOOST)Composable, command line parser for C++ 11 and beyondargv

CLI11

(1 C++, BSD)Feature-rich CLI parsing in modern C++11argv

Cmdline

(1 C++, BSD)Command-line argument parsingargv

Flags

(1 C++, PD)Command-line argument parsingargv

Kgflags

(1 C, MIT)Command-line argument parsingargv

Linkom

(1 C, MIT)Command-line argument parsing w/ DOS-style optionsargv

Optionparser

(1 C++, MIT)Command-line argument parsingargv

Parg

(2 C, PD)Command-line argument parsingargv

ProgramOptions.hxx

(1 C++, MIT)Command-line argument parsingasm

Chasm

(2 C, PD)Runtime X64 assembleraudio

Atomix

(1 C, PD)Wait-free atomic sound mixeraudio

Aw_ima.h

(1 C, MIT)IMA-ADPCM audio decoderaudio

Btac1c

(1 C, MIT)MS-IMA_ADPCM variantaudio

Chibi-xmplay

(2 C, BSD3)XM module playback libraryaudio

clownresampler

(1 C, BSD0)Audio resamplingaudio

Miniaac

(1 C, BSD0)AAC-LC decoder with a push-style APIaudio

Miniaudio

(2 C, PD)Audio playback and capture libraryaudio

Miniflac

(1 C, BSD0)FLAC decoder with a push-style APIaudio

Minimp3

(1 C, CC0)Minimalistic MP3 decoder with sse/neon supportaudio

MojoAL

(1 C, ZLIB)Full OpenAL 1.1 implementationaudio

Nanoalsa

(1 C, MIT)Tiny PCM playback under Linuxaudio

Organya.h

(1 C, BSD0)Organya/OrgMaker music rendereraudio

Pocketmod

(1 C, MIT)ProTracker MOD file rendereraudio

Stb_hexwave

(1 C, PD)Audio waveform synthesizeraudio

Stb_vorbis

(1 C, PD)Decode ogg vorbis files from file/memory to float/16-bit signed outputaudio

Tflac

(1 C, BSD0)Freestanding FLAC encoding library in C89audio

TinySoundFont

(1 C, MIT)SoundFont2 loader & synthesizerbench

Picobench

(1 C++, MIT)Microbenchmarkingbench

Ubench.h

(1 C, PD)Microbenchmarkingc

Errnoname

(2 C, BSD0)Extended errno messagesc

Minicoro

(1 C, PD-0MIT)Stackful cross-platform coroutine libraryc

Stb_sprintf

(1 C, PD)Fast sprintf, snprintf for C/C++cpp

Filesystem

(1 C++, MIT)Implementation of std::filesystemcpp

Outcome

(1 C++, APACHE2-BOOST)Outcome and result C++ containerscrypt

Ggentropy

(2 C++, ISC)Cross platform entropy librarycrypt

Monocypher

(2 C, PD)High-quality small cryptography librarycrypt

Random3

(1 C, PD)Crypt-random generatorcrypt

TweetNaCl

(2 C, PD)High-quality tiny cryptography librarycsv

CSVstream

(1 C++, MIT)CSV parsercsv

Fast C++ CSV Parser

(1 C++, BSD)CSV parsercsv

Rapidcsv

(1 C++, BSD)CSV parsercsv

Vince's CSV Parser

(1 C++, MIT)CSV parser and serializerdate

Date

(1 C++, MIT)Date and time librariesdebug

B_stacktrace

(1 C, MIT)Stack tracingdebug

Dbgtools

(2 C, ZLIB)Cross-platform debug util librariesdebug

Debug-assert

(1 C++, ZLIB)Modular assertion macrodebug

Debugbreak

(1 C, BSD)Programmatic debug breakdebug

Loguru

(1 C++, PD)Flexible loggingdebug

Pempek_assert.cpp

(2 C++, WTFPL2)Flexible assertionsdev

Libue

(1 C, MIT)Helper library for Linux device hot-plug eventds

AArray

(1 C, PD)Arrays/strings: generic, safeds

Avl

(2 C, PD)AVL treeds

Convenient Containers

(1 C, MIT)Typesafe data structures (vector, list, map, set, string, etc.) with a fully generic API and no boilerplateds

DG_dynarr.h

(1 C, PD)Typesafe dynamic arrays (like std::vector) for plain Cds

Dynarr

(1 C, PD)Dynamic array containerds

DynaVar

(1 C++, GPL3)Object which can store any type of primitive data typeds

Fifo_declare.h

(1 C, LGPL2)Thread/core safe FIFOds

Hashmap

(1 C, BSD0)Type-safe hashmapsds

Itlib

(1 C++, MIT)Several C++11 standard-contaner-like libraries and helpersds

Jhr_skip_list

(1 C++, PD)Skip Listsds

Jrsl

(1 C, PD)Skip Listsds

Klib

(2 C, MIT)Many 2-file libs: hash, sort, b-tree, etcds

Libintrusive

(2 C, PD)Intrusive data structuresds

Libpqueue

(2 C, BSD)Priority queue (heap)ds

LinkedList

(2 C, MIT)Linked list C++ds

Mempool

(1 C++, MIT)Efficient minimal memory pool implementation for C++ds

PackedArray

(2 C, WTFPL2)Memory-efficient array of elements with non-pow2 bitcountds

Selist

(2 C, ISC)Space-efficient linked-listds

Simclist

(2 C, BSD)Linked-listds

Stb_ds

(1 C, PD)Typesafe dynamic array and hash tables for C, will compile in C++ds

Uthash

(2 C, BSD)Several 1-header, 1-license-file libs: generic hash, list, etcds

Vector

(1 C, BSD0)Type-safe dynamic arraysds

Verstable

(1 C, MIT)High performance and typesafe generic hash tableds

Yar

(1 C, PD)Type-safe dynamic arrays in Cengine

Kit

(1 C, PD)Tiny library for making small games with big pixelsengine

OlcPixelGameEngine

(1 C++, BSD3)Game engineengine

Punity

(1 C, MIT)A tiny game engine in Ceval

Ceval-single-header

(1 C, MIT)A single-header library for parsing and evaluation of arithmetic expressionseval

Evalmath

(2 C++, 0MIT)C++23 simple math string evaluation with specific error messageseval

ExprTk

(1 C++, MIT)Runtime mathematical expression parser and evaluation engine.eval

Miscsrc's eval.h & eval.cpp

(2 C, UNLICENSE)C math string evaluationeval

TinyExpr

(2 C, ZLIB)Evaluation of math expressions from stringsfile

ByteArray

(2 C, GPL3)Library to read, write and print binary filesfile

Dirent

(1 C, MIT)Dirent for Windows: retrieve file & dir infofile

fs

(2 C, PD/MIT-0)File system and archive abstraction library, supports fs/zip/pak/RAM (Win/Mac/Unix)file

Miniphysfs

(1 C, ZLIB)Single-file port of PhysFS, a fs/zip abstractionfile

Tfile

(1 C++, MIT)FILE* wrapper does read-write-append-seek-close (Win/Mac/Unix)file

TinyDir

(1 C, BSD)Cross-platform directory reading (Win/POSIX/MinGW)file

VeloxFS

(1 C, PD)Single-header C99 filesystem for embedded, game assets, or persistent binary storagefile

Whereami

(2 C, WTFPL2)Get path/filename of executable or modulefont

Blit-fonts

(1 C, ISC)Bitmap font blittersfont

Ssfn.h

(1 C, MIT)Scalable/bitmap/pixmap font rendererfont

Stb_easy_font

(1 C, PD)Quick-and-dirty easy-to-deploy bitmap font for printing frame rate, etcfont

Stb_truetype

(1 C, PD)Parse, decode, and rasterize characters from truetype fontsgame

Raycastlib.h

(1 C, CC0)Advanced raycasting rendering library, pure C99 with no dependencies, only 32bit int mathgame

Roguelike.h

(1 C, MIT)Simple game library for Roguelike games: pathfinding, Dijkstra graphs, dungeon generation...game

Stb_connected_components

(1 C, PD)Incrementally compute reachability on gridsgame

Stb_herringbone_wang_tile

(1 C, PD)Herringbone Wang tile map generatorgame

Stb_tilemap_editor

(1 C, PD)Embeddable tilemap editorgpu

Cds_gpubuf

(1 C, PD)Compress/interleave arrays from/into GPU buffers.hash

Hash.c

(2 C, PD)SHA1/SHA3/MD5 hasheshash

Lonesha256

(1 C, PD)SHA256 implementationhash

PicoSHA2

(1 C++, MIT)SHA256 implementationhash

XxHash

(2 C, BSD)Fast hash functionimage

Bitmap

(1 C++, MIT)Bitmap decoder and utilitiesimage

Cro_mipmap.h

(1 C, PD)Average, min, max mipmap generatorsimage

FlatCV

(2 C, ISC)Image processing and computer vision libraryimage

Framepacker

(1 C++, MIT)Texture bin packing algorithmimage

Jo_sift

(1 C, PD)Image feature detection and matchingimage

Stb_image

(1 C, PD)Image loading/decoding from file/memory: JPG, PNG, TGA, BMP, PSD, GIF, HDR, PICimage

Stb_image_resize

(1 C, PD)Resize images larger/smaller with good qualityimage

Stb_image_write

(1 C, PD)Image writing to disk: PNG, TGA, BMPimage

Stb_perlin

(1 C, PD)Perlin's revised simplex noise w/ different seedsimage

Stb_rect_pack

(1 C, PD)Simple 2D rectangle packer with decent qualityimage

Tiffloader

(2 C, PD)TIFF image loaderimageEXR

Miniexr

(2 C++, PD)OpenEXR writer, needs header fileimageEXR

Tinyexr

(1 C, BSD)EXR image read/write, uses miniz internallyimageGIF

Gif.h

(1 C++, PD)Animated GIF writer (can only include once)imageGIF

Gif_load

(1 C, PD)(animated) GIF readerimageGIF

Jo_gif.cpp

(1 C++, PD)Animated GIF writer (CPP file can also be used as H file)imageGIF

msf_gif.h

(1 C, PD)Animated GIF writerimageJPG

Jpeg-compressor

(2 C++, PD)2-file JPEG compress, 2-file JPEG decompressimageJPG

NanoJPEG

(1 C, MIT)JPEG decoderimageJPG

Tiny_jpeg.h

(1 C, PD)JPEG encoderimageJPG EXIF

Easyexif

(2 C++, BSD2)EXIF metadata extractor for JPEG imagesimageJPG EXIF

TinyEXIF

(2 C++, BSD)Parse EXIF data from JPEG (XMP w/ TinyXML2 lib)imagePDF

PDFgen

(2 C, PD)PDF writerimagePNG

Lodepng

(2 C, ZLIB)PNG encoder/decoderimagePNG

Picopng.cpp

(2 C++, ZLIB)Tiny PNG loaderimagePNG

TinyPngOutput

(2 C, LGPLv3)PNG writerimagePNM

PNM

(1 C++, APACHE2)PBM, PGM and PPM reader and writerimageSVG

NanoSVG

(1 C, ZLIB)1-file SVG parser; 1-file SVG rasterizerimageWEBP

Jebp

(1 C, 0MIT)Single header WebP decoder (only supports lossless images)imageWEBP

tiny-webp

(1 C, BSD3)Single header WebP decoderini

Inih

(2 C, BSD).ini file parserinput

EasyTab

(1 C, PD)Multi-platform tablet inputjson

Ajson

(1 C++, BOOST)JSON serialize & deserialize w/ STL supportjson

CJSON

(1 C, MIT)JSON parserjson

CJSON

(1 C, MIT)JSON parserjson

csonpath

(1 C, BSD3)JsonPath implementationjson

Jsmn

(1 C, MIT)Minimalistic JSON parserjson

Json-build

(1 C, MIT)JSON serializerjson

Json.h

(1 C, PD)JSON parserjson

Json.hpp

(1 C++, MIT)JSON parse, serialize, deserializejson

Jsonc

(1 C, MIT)Extremely fast and extremely small (~60 SLoC) JSON parserjson

Jzon.h

(2 C++, MIT)JSON parserjson

Parson

(2 C, MIT)JSON parser and serializerjson

PicoJSON

(1 C++, BSD)JSON parse/serializerjson

Sjson

(1 C, BSD2)JSON encode/decoderlog

log.c

(2 C, MIT)Extremely small (~150 LoC) logging librarylog

Microlog

(2 C, MIT)Extensible and configurable logging librarylogic

FFSM2

(1 C++, MIT)Flat FSMlogic

HFSM2

(1 C++, MIT)Hierarchical FSMmath

Aint

(1 C, PD)Single-header C99 library for large integersmath

Amoeba

(1 C, MIT)Constraint solver (Cassowary) w/Lua bindingmath

Cds_spline

(1 C, PD)Spline utilsmath

Clipper

(2 C++, BOOST)Line & polygon clipping & offsettingmath

Delaunay (Constrained)

(1 C, PD)2D Constrained Delaunay Triangulationmath

Delaunay

(2 C++, BSD3)2D and 3D Delaunay triangulationmath

Df

(1 C, PD)Find voronoi region in linear time of size of latticemath

Dvector

(1 C, PD)2D/3D vector/quaternion/matrix math librarymath

Fft

(1 C++, PD)Fast Fourier Transformmath

HMM Toolkit

(1 C, GPL2)Discrete and continuous Hidden Markov Models (DHMM, CHMM)math

Jc_voronoi

(1 C, MIT)Find voronoi regions on float/double datamath

Linmath.h

(1 C, WTFPL2)Vector librarymath

M_math.h

(1 C, ZLIB)Math with C/OpenCL portabilitymath

Matrix-hpp

(1 C++, MIT)Matrix class container for linear algebra computationsmath

Nanoflann

(1 C++, BSD)Build KD trees for point cloudsmath

Nv_voronoi.h

(1 C, PD)Find voronoi regions on lattice w/ integer inputsmath

Omm

(1 C++, MIT)Template open multi-methodsmath

OpenNL

(2 C++, BSD3)Linear and eigen solversmath

Par_msquares

(1 C, MIT)Convert (binarized) image to trianglesmath

Par_shapes

(1 C, MIT)Generate various 3d geometric shapesmath

Par_streamlines

(1 C, MIT)Tessellate wide lines and curves with shading attributesmath

PoissonGenerator.h

(1 C++, MIT)Poisson disk points generator (disk or rect)math

PolyPartition

(2 C++, MIT)Polygon triangulation, partitioningmath

Precision

(1 C++, PD)Arbitrary-precision integer and rational arithmeticmath

Prns.h

(1 C, PD)Seekable pseudo-random number sequencesmath

Rfft.h

(1 C, PD)Fast Fourier Tranform for arbitrary array sizesmath

Sdf.h

(1 C, MIT)Compute signed-distance field from antialiased imagemath

ShaderFastLibs

(1 C++, MIT)(also HLSL) Approximate transcendental functions optimized for shaders (esp. GCN)math

Simple_linear_regression

(1 C, MIT)Simple linear regressionmath

Simrank.hpp

(2 C++, MIT)SimRank graph similarity algorithmmath

smath

(1 C++, APACHE2)Linear algebra math library (C++23)math

Sobol.h

(1 C, PD)Sobol & stratified sampling sequencesmath

Statistics-Tool-Box

(1 C, PD)Statistical functionsmath

Stb_divide

(1 C, PD)More useful 32-bit modulusmath

SummedAreaTable

(1 C++, MIT)Summed-Area Table generation and sum/avg queriesmath

Tomas Akenine-Moller snippets

(2 C, PD)Various 3D intersection calculations, not lib-ifiedmath

Vmath

(1 C, PD)Vector/matrix librarymath

Voxelizer

(1 C, MIT)Convert triangle mesh to voxel triangle meshmath

Xatlas

(2 C++, MIT)Mesh parameterizationmem

Buddy_alloc

(1 C, BSD0)Buddy memory allocatormem

easy_memory

(1 C, MIT)Platform-agnostic memory management system with LLRB trees and modular sub-allocatorsmem

Stb_leakcheck

(1 C, PD)Quick-and-dirty malloc/free leak-checkingmem

Wb_alloc

(1 C, PD)Custom allocators in a single-headermesh

Cgltf

(1 C, MIT)GlTF 2.0 file loadermesh

Fast_obj.h

(1 C, MIT)Wavefront OBJ file loadermesh

M3d.h

(1 C, MIT)Model 3D importer/exporter (with Blender, Goxel, WebGL JS and assimp integration)mesh

Objzero

(2 C, MIT)Wavefront OBJ file loadermesh

Qll_q3.h

(1 C++, WTFPL2)Quake3 BSP loadermesh

Tinyobjloader-c

(1 C, MIT)Wavefront OBJ file loadermesh

Tinyobjloader

(1 C++, MIT)Wavefront OBJ file loadermesh

Tinyply

(2 C++, PD)PLY mesh file loadermesh

Tk_objfile

(1 C, MIT)OBJ file loadermisc

ASAP

(1 C++, MIT)Library for parsing, printing, iterating and operating on dates.misc

ASN.1 DER

(2 C, PD)Encoder/decoder for ASN.1 DER format.misc

CLM_LIBS

(1 C, PD)Diverse utilitiesmisc

Color-Toolkit

(1 C, GPL2)Color conversion utils (RGB, XYZ, Lab, CIE76, CIE94 and CIEDE200)misc

Cpp-generators

(1 C++, BSD)Generators in C++misc

Ebnn.h

(1 C, MIT)BNN (Binarized Neural Networks)misc

H.h

(1 C, GPL3)Diverse utilitiesmisc

Hedley

(1 C, PD)Compiler portability, optimization, static analysis, etc.misc

MakeID.h

(1 C++, PD)Allocate/deallocate small integer IDs efficientlymisc

Mmu

(2 C, MIT)Memory management and data structure toolsetmisc

OpenGA

(1 C++, MPL2)A C++ Generic Algorithm solver librarymisc

PlusCallback

(1 C++, ZLIB)Function/method callbacksmisc

Process.h

(1 C, PD)Process control APImisc

QR-Code-generator

(2 C, MIT)QR Code generatormisc

Qsort

(1 C, MIT)Qsort algorithm as a C macromisc

Scogem.c

(2 C, PD)URL parsermisc

Sili

(1 C, PD)C toolchain for modern C programming, strings, arrays, files, threading, ectmisc

Smallxrm.c

(2 C, PD)Implementation of X resource managermisc

Stb_include

(1 C, PD)Implement recursive #include support, particularly for GLSLmisc

Stmr

(2 C, MIT)Extract English word stemsmisc

X.h

(1 C, MULAN2)Cross-platform C/C++ utilitiesnav

M_path_finding.h

(1 C, ZLIB)Floodfill-based path findingnav

Micropather

(2 C++, ZLIB)Pathfinding with A*net

Civetweb

(2 C, MIT)HTTP server, fork of Mongoosenet

Cpp-httplib

(1 C, MIT)Cross-platform HTTP server/clientnet

Enet

(1 C, MIT)Reliable UDP networking librarynet

EWS

(1 C, BSD)HTTP servernet

Happyhttp

(2 C++, ZLIB)HTTP client requestsnet

Libcluon

(1 C++, MPL2)Cross-platform socket wrapper and data marshalling with native implementations for

Protobuf

,

LCM

/

ZCM

, JSON, and

MsgPack

serialization/deserializationnet

Librg

(1 C, BSD3)World/entity synchronization multiplayer librarynet

LUrlParser

(2 C++, MIT)Lightweight URL & URI parser RFC 1738, RFC 3986net

Mongoose

(2 C, GPLv2)HTTP servernet

Netq

(1 C, MIT)Reliable datagram librarynet

Par_easycurl.h

(1 C, MIT)CURL wrappernet

Simpletls.c

(2 C, PD)Function to create a socket and connect to a remote server with TLSnet

Swrap

(1 C, PD)TCP and UDP socket wrappernet

Tiniest-analytics

(2 C++, MIT)Cross-platform analytics for games (using Google Analytics <4)net

Tiny-MQTT-c

(4 C, PD)Small implementation of (some of) the MQTT protocol in Cnet

Tlse

(2 C, PD-BSD2)TLS v1.0, 1.2, 1.3 and DTLS 1.0, 1.2 implementationsnet

Webster

(2 C++, APACHE2)Standalone HTTP server/clientnet

Yocto

(2 C, PD)Non-production-use HTTP servernet

Zed_net

(1 C, PD)Cross-platform socket wrappernet

Znet

(1 C, MIT)Cross-platform networking w/ Lua bindingnn

Qmtik

(1 C, MIT)Quantized Model Training and Inference Kitpack

Dmc_unrar

(1 C, GPL2)RAR file decompressionpack

Fastlz

(2 C, MIT)Fast but larger LZ compressionpack

Lz4

(2 C, BSD)Fast but larger LZ compressionpack

Microtar

(2 C, MIT)Lightweight tar librarypack

Miniz.c

(1 C, MIT)Compression, decompression, ZIP file, PNG writingpack

Nibrans

(1 C, PD)Adaptive rANS librarypack

Pithy

(2 C, BSD)Fast but larger LZ compressionpack

Rle

(1 C, MIT)Run-length en/decoderpack

Stb_dxt

(1 C, PD)Real-time DXT compressorparse

Cmp

(2 C, MIT)MessagePack parser and serializerparse

Cpp-peglib

(1 C, MIT)PEG (Parsing Expression Grammars) libraryparse

FlexiC

(2 C, ZLIB)Google FlexBuffer parser and writerparse

Furi

(1 C, MIT)URL & URI parsingparse

Html-parse.c

(2 C, GPL)HTML parser (wget)parse

SLRE

(1 C, GPL2)Regular expression matcherparse

Stb_c_lexer

(1 C, PD)Simplify writing parsers for C-like languagesparse

Tok

(1 C, MIT)Configurable tokenizerparse

Tomlplusplus

(1 C++, MIT)TOML parser and serializerparse

Udisasm

(1 C, MIT)Extremely small disassembler for ARMv8.2 AArch64 (~65k)parse

Unformat

(1 C++, PD)Parses formatted strings (reverse of std::format)prng

Random

(1 C++, MIT)Convenient API for randomprng

Ranxoshi256

(1 C, PD)Xoshiro256 algorithmprng

SimplexNoise

(1 C++, BSD2)Collection of noise generatorsprng

UTL Random

(1 C++, MIT)Fast random for Monte-Carlo simulationsprofile

MicroProfile

(4 C++, PD)CPU (and GPU?) profiler, 1-3 header files, uses miniz internallyprofile

Prof

(1 C, MIT)Profiler for Linuxprofile

Remotery

(2 C, APACHE2)CPU/GPU profiler Win/Mac/Linux, using web browser for viewerraster

Canvas_ity

(1 C++, ISC)2D rasterizerregex

Remimu

(1 C, CC0)Regex enginescript

Duktape

(2 C, MIT)Embeddable JavaScript enginescript

LIL

(2 C, ZLIB)Interpreter for a Tcl-like scripting languagescript

Lualite

(1 C++, MIT)Generate Lua bindings in C++script

Minilua

(1 C, MIT)Single-file port of Lua scripting languagescript

MY-BASIC

(2 C, MIT)Interpreter for a BASIC dialect scripting languagescript

Picol

(1 C, BSD)Interpreter for a Tcl-like scripting languagescript

PocketPy

(2 C, MIT)Portable Python 3.x Interpreter in Modern C for Game Scriptingscript

S7

(2 C, BSD)Interpreter for a subset of Scheme (R5RS/R7RS)script

Xpl

(1 C, WTFPL2)X Programming Languageserial

Archive

(1 C++, PD)Binary serialize & deserlize w/ STL supportserial

Blob_tree

(1 C++, MIT)Binary tree serializerserial

Cista

(1 C++, MIT)Cross-platform high performance zero copy C++17 serialization/deserializationserial

Libcluon

(1 C++, MPL2)Cross-platform data serialization/deserialization with native implementations for

Protobuf

,

LCM

/

ZCM

, JSON, and

MsgPack

serial

Qserial

(1 C++, BSD3)Schema-driven serialization libraryserial

Serialization helper

(1 C, WTFPL2)Serialization helperserial

Visit_struct

(2 C++, BOOST)Struct-field reflectionstring

bbj_string

(1 C, PD)Simple string librarystring

Csplit

(1 C, MIT)String splitting and processing single-header librarystring

Dfa

(2 C, MIT)Fast UTF-8 decoder (need a header file)string

Gb_string.h

(1 C, PD)Dynamic stringsstring

Ggformat

(2 C++, ISC)Printf replacementstring

Inja.hpp

(1 C++, MIT)Template enginestring

Levenshtein

(2 C, MIT)Compute edit distance between two stringsstring

Obfuscate

(1 C++, PD)Guaranteed compile-time string literal obfuscation library for C++14string

Str.h

(1 C++, PD)Simple C++ string type with an optional local bufferstring

Str

(2 C, BSD)Yet another string library for C languagestring

Str_view.hpp

(1 C++, MIT)Null-termination-aware string-view classstring

Tinyformat

(1 C++, BOOST)Typesafe printfstring

Utf8

(1 C, PD)UTF-8 string librarysvg

SimpleSVG

(1 C++, BSD3)Easy to use SVG librarysys

Doops

(1 C, PD)Event loop librarysys

Dotenv

(1 C++, Apache2)Lightweight .env File Loader Librarysys

Endianness.h

(1 C, PD)Endianness conversion and detectionsys

JArgsParser

(1 C++, MIT)Arguments parsersys

Openmodal

(1 C, MIT)Native file modalssys

Rang

(1 C++, PD)Cross-platform colored console textsys

Xproc

(2 C++, MIT)Foreign Process Informationthread

Bikeshed.h

(1 C, MIT)Cross-platform lock free fixed memory hierarchical work schedulerthread

Cds_job

(1 C++, PD)Lock-free job queuethread

Cds_sync

(1 C, PD)Collection of synchronization primitivesthread

TinyCThread

(2 C, ZLIB)Cross-platform implementation of the C11 Threads APIthread

TinyThread++

(2 C++, ZLIB)Cross-platform implementation of the C++11 Threads APIui

Clay

(1 C, ZLIB)High performance 2D UI layout libraryui

Dear imgui

(9 C++, MIT)An immediate-mode GUI formerly named "ImGui";

3rd-party C wrapper

ui

Libcmdf

(1 C, PD)A small library for writing CLI applicationsui

Linenoise

(2 C, BSD)Terminal readline w/ history etcui

Nuklear

(1 C, PD)Minimal GUI toolkitui

Stb_textedit

(1 C, PD)Guts of a text editor for games etc implementing them from scratchui

Tinyfiledialogs

(2 C, ZLIB)Modal dialogs inc. file open/save (Win/Mac/Linux)ui

Wcwidth9

(1 C, APACHE2)Platform independent wcwidth with full unicode 9 supportui

Webview

(1 C, MIT)Cross-platform webview libraryunit

Catch2

(1 C++, BOOST)Unit testingunit

Catch

(1 C++, BOOST)Unit testingunit

Clove-unit

(1 C, MIT)Unit testingunit

Doctest

(1 C++, MIT)Unit testingunit

Fctx

(1 C, BSD)Unit testingunit

Greatest

(1 C, ISC)Unit testingunit

Hippomocks

(1 C++, LGPL)Unit testingunit

Labrat

(1 C, PD)Unit testingunit

Minctest

(1 C, ZLIB)Unit testingunit

Munit

(1 C, MIT)Unit testingunit

Picotest

(1 C, MIT)Unit testingunit

Rexo

(1 C, PD)Framework for C89/C++ featuring automatic registration of tests and a polished APIunit

SPUT

(1 C, BSD)Unit testingunit

Trompeloeil

(1 C++, BOOST)Unit testingunit

Utest.h

(1 C, PD)Unit testingunit

Utest

(1 C, MIT)Unit testingunit

Walter

(1 C, PD)Unit testinguuid

Uuid4

(2 C, WTFPL2-MIT)UUID v4 generatoruuid

Uuid_h

(1 C, ZLIB)UUID generatorvector

Algebra3.h

(1 C++, PD)Vector utilities for 2, 3, and 4 element vectors, all inlinevector

CcVector.h

(1 C, PD)Vector, quaternion and matrix mathvector

Handmade Math

(1 C, PD)Vector mathvector

Hypatia

(1 C, MIT)Vector/matrix/quaternion mathvector

Linalg.h

(1 C++, PD)Vector/matrix/quaternion mathvector

Linalg

(1 C, ISC)Vector/matrix/quaternion mathvideo

Jo_mpeg

,

original

(1 C, PD)MPEG file writervideo

Pl_mpeg

(1 C, MIT)MPEG1 video and audio decoderxml

Pugixml

(2 C++, MIT)Light-weight C++ XML processing libraryxml

Tinyxml2

(2 C++, ZLIB)Simple, small, efficient, C++ XML parserxml

Yxml

(2 C, MIT)Small, fast and correct XML parseryaml

Mini-yaml

(2 C++, MIT)YAML parser and serializerSecondary listing

Entries in this appendix either do not offer a single-header file directly, or the single-header file is computer generated, or you have to build the single-header by yourself, or lack any other major requirement mentioned above. However, some of you may find the links below still relevant.

taglibrarydescriptiondb

Sqlite

(2 C, PD)Self-contained, SQL database engine.file

DTW

(1 C, MIT)File and folder utilitiesnet

CWebStudio

(1 C, MIT)WebServer with embedded JSON/HTML utilitiespack

Zstd

(? C, BSD3)Fast real-time compression algorithmsys

Cpuid

(1 C, ???)Cross-platform cpuid intrinsicsys

Iathook

(1 C, ???)Import address table hooking library (x86/x64,w32)List FAQ

Can I link directly to this list?

Yes. For historical reasons,

this is the preferred link.

Why isn't library XXX which is made of 3 or more files on this list?

We draw the line arbitrarily at 2 files at most. Some of these libraries are still easy to drop into your project and build, so you might still be ok with them. But since people come to stb for single-file public domain libraries, we feel that starts to get too far from what we do here.

Why isn't library XXX which is at most two files and has minimal other dependencies on this list?

Probably because we don't know about it, feel free to submit a pull request or issue (it can be your own library or somebody else's). But we might not include it for various other reasons, including subtleties of what is 'minimal other dependencies' and subtleties about what is 'lightweight'.

What are the differences between C, C++ and C/C++ in the API column?

For the API column, "C" means a C library that may be C++ compatible but this not guaranteed nor verified, "C++" means C++ only and thus not C compatible, and "C/C++" means a C library with additional features when compiled in C++ mode.

Why are the LICENSING terms required in the header and source files?

Please note that every file that must be included in a user's project counts; a header and a source file is 2 files, but a header file, source file, and LICENSE (if the license isn't in the source file) is 3 files, and won't be accepted, because it's not 2 files. But actually 'LICENSE' is a problem for just dropping the library in a source tree anyway, since it's not scoped to just the library, so library authors are encouraged to include the license in the source file and not require a separate LICENSE.