data structures|[klib](http://attractivechaos.github.io/klib/) | MIT |C/C++| 2 | many 2-file libs: hash, sort, b-tree, etc
data structures | [uthash](https://github.com/troydhanson/uthash) | BSD |C/C++| 2 | several 1-header, 1-license-file libs: generic hash, list, etc
data structures | [PackedArray](https://github.com/gpakosz/PackedArray) | **WTFPLv2** | C | 2 | memory-efficient array of elements with non-pow2 bitcount
data structures | [minilibs](https://github.com/ccxvii/minilibs) | **public domain** | C | 2 | two-file binary tress (also regex, etc)
data structures |**[DG_dynarr.h](https://github.com/DanielGibson/Snippets/)** | **public domain** |C/C++|**1**| typesafe dynamic arrays (like std::vector) for plain C
geometry math |**[nv_voronoi.h](http://www.icculus.org/~mordred/nvlib/)** | **public domain** |C/C++|**1**| find voronoi regions on lattice w/ integer inputs
geometry math | [sdf.h](https://github.com/memononen/SDF) | MIT |C/C++|**1**| compute signed-distance field from antialiased image
geometry math | [nanoflann](https://github.com/jlblancoc/nanoflann) | BSD | C++ |**1**| build KD trees for point clouds
geometry math | [jc_voronoi](https://github.com/JCash/voronoi) | MIT |C/C++|**1**| find voronoi regions on float/double data
geometry math | [par_msquares](https://github.com/prideout/par) | MIT |C/C++|**1**| convert (binarized) image to triangles
geometry math | [par_shapes](http://github.prideout.net/shapes) | MIT |C/C++|**1**| generate various 3d geometric shapes
geometry math | [Tomas Akenine-Moller snippets](http://tinyurl.com/ht79ndj) | **public domain** |C/C++| 2 | various 3D intersection calculations, not lib-ified
geometry math | [Clipper](http://www.angusj.com/delphi/clipper.php) | Boost | C++ | 2 | line & polygon clipping & offsetting
geometry math | [PolyPartition](https://github.com/ivanfratric/polypartition) | MIT | C++ | 2 | polygon triangulation, partitioning
geometry math | [Voxelizer](https://github.com/karimnaaji/voxelizer) | MIT |C/C++|**1**| convert triangle mesh to voxel triangle mesh
geometry math | [yocto_bvh.h](https://github.com/xelatihy/yocto-gl) | MIT |C/C++|**1**| ray-casting and closest-element queries of bounding-volume hierarchy
geometry math | [yocto_shape.h](https://github.com/xelatihy/yocto-gl) | MIT |C/C++|**1**| shape generation, tesselation, normals, etc.
graphics (3d) | [yocto_trace.h](https://github.com/xelatihy/yocto-gl) | MIT |C/C++|**1**| physically-based unidirectional path tracer w/ MIS for direct lights
graphics (3d) | [yocto_symrigid.h](https://github.com/xelatihy/yocto-gl) | MIT |C/C++|**1**| rigid body simulator (sequential impulse/PGS) with support for concave objects
graphics (2d) | [blendish](https://bitbucket.org/duangle/oui-blendish/src) | MIT |C/C++|**1**| blender-style widget rendering
graphics (2d) | [tigr](https://bitbucket.org/rmitton/tigr/src) | **public domain** |C/C++| 2 | quick-n-dirty window text/graphics for Windows and OSX
graphics (3-D) |**[lightmapper](https://github.com/ands/lightmapper#lightmapper)** | **public domain** |C/C++|**1**| use your OpenGL renderer to offline bake lightmaps
images | [jo_gif.cpp](http://www.jonolick.com/home/gif-writer) | **public domain** | C++ |**1**| animated GIF writer (CPP file can also be used as H file)
images |**[gif.h](https://github.com/ginsweater/gif-h)** | **public domain** | C |**1**| animated GIF writer (can only include once)
math | [mm_vec.h](https://github.com/vurtun/mmx) | BSD |C/C++|**1**| SIMD vector math
math |**[Handmade Math](https://github.com/StrangeZak/Handmade-Math)** | **public domain** |C/C++|**1**| vector math
math |**[gb_math](https://github.com/gingerBill/gb/blob/master/gb_math.h)** | **public domain** |C/C++|**1**| Vector, quaternion and matrix math w/o math.h
math |**[ccVector.h](https://github.com/jobtalle/ccVector)** | **public domain** |C/C++|**1**| Vector, quaternion and matrix math
math | [ShaderFastLibs](https://github.com/michaldrobot/ShaderFastLibs) | MIT | C++ |**1**| (also HLSL) approximate transcendental functions optimized for shaders (esp. GCN)
math | [TinyExpr](https://github.com/codeplea/tinyexpr) | zlib | C | 2 | evaluation of math expressions from strings
math | [linalg.h](https://github.com/sgorsten/linalg) | **unlicense** | C++ |**1**| vector/matrix/quaternion math
math | [PoissonGenerator.h](https://github.com/corporateshark/poisson-disk-generator) | MIT | C++ |**1**| Poisson disk points generator (disk or rect)
math | [prns.h](http://marc-b-reynolds.github.io/shf/2016/04/19/prns.html) | **public domain** |C/C++|**1**| seekable pseudo-random number sequences
math | [aomeba](https://github.com/starwing/amoeba) | MIT |C/C++|**1**| constraint solver (Cassowary) w/Lua binding
tests | [minctest](https://github.com/codeplea/minctest) | zlib | C |**1**| unit testing
tests | [greatest](https://github.com/silentbicycle/greatest) | iSC | C |**1**| unit testing
tests | [µnit](https://github.com/nemequ/munit) | MIT | C |**1**| unit testing
user interface | [dear imgui](https://github.com/ocornut/imgui) | MIT | C++ | 9 | an immediate-mode GUI formerly named "ImGui"; [3rd-party C wrapper](https://github.com/Extrawurst/cimgui)
_misc_ | [stmr](https://github.com/wooorm/stmr.c) | MIT | C | 2 | extract English word stems
_misc_ | [levenshtein](https://github.com/wooorm/levenshtein.c) | MIT | C | 2 | compute edit distance between two strings
There are also these XML libraries, but if you're using XML, shame on you:
- parsing: [tinyxml2](https://github.com/leethomason/tinyxml2): XML
- parsing: [pugixml](http://pugixml.org/): XML (MIT license)
Also you might be interested in other related, but different lists:
- [clib](https://github.com/clibs/clib/wiki/Packages): list of (mostly) small single C functions (licenses not listed)
## New libraries and corrections
Submissions of new libraries: I accept submissions (as issues or as pull requests). 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.
Corrections: if information for a library above is wrong, please send a correction as an
issue, pull request, or email. Note that if the list indicates a library works from both
C/C++, but it doesn't, this could be an error in the list or it could be a bug in the
library. If you find a library doesn't work in 32-bit or 64-bit, the library should be
removed from this list, unless it's a bug in the library.
## *List FAQ*
### Can I link directly to this list?
Yes, you can just use this page. If you want a shorter, more readable link, you can use [this URL](https://github.com/nothings/stb#other_libs) to link to the FAQ question that links to this page.
### Why isn't library XXX which is made of 3 or more files on this list?
I draw the line arbitrarily at 2 files at most. (Note that some libraries that appear to
be two files require a separate LICENSE file, which made me leave them out). 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, I 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 I don't know about it, feel free to submit a pull request, issue, email, or tweet it at
me (it can be your own library or somebody else's). But I might not include it for various
other reasons, including subtleties of what is 'minimal other dependencies' and subtleties
about what is 'lightweight'.
### Why isn't SQLite's amalgamated build on this list?