milsymbol is a small, pure JavaScript library that generates military unit symbols according to the MIL-STD-2525 and STANAG APP-6 family of standards. It takes a Symbol Identification Code (SIDC) and an optional set of style and modifier options, then produces a fully rendered symbol as an SVG string, an SVG DOM element, or an HTML Canvas element — with no external dependencies and no fonts or images required.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/spatialillusions/milsymbol/llms.txt
Use this file to discover all available pages before exploring further.
Quickstart
Create your first military symbol in under 5 minutes.
Installation
Install via npm, yarn, pnpm, or a CDN script tag.
SIDC Codes
Understand letter-based and number-based symbol identification codes.
Symbol Options
Explore the full set of style, modifier, and rendering options.
Key Features
milsymbol is designed to be fast, flexible, and easy to embed in any JavaScript environment. The following highlights cover what makes it stand out.Zero Dependencies
A single JavaScript file with no runtime dependencies. Can create over 1,000 SVG symbols in less than 20 milliseconds.
Multiple Standards
Supports MIL-STD-2525B, C, D, and E as well as STANAG APP-6 B, D, and E — both letter-based and number-based SIDCs.
SVG and Canvas Output
Render symbols as SVG strings, SVG DOM elements, HTML Canvas elements, or base64-encoded data URLs.
Text Modifiers
Full support for all standard text modifier fields — unique designation, quantity, DTG, location, higher formation, and more.
Color Modes
Built-in Light, Medium, and Dark color modes with civilian color support. Register custom color modes via
ms.setColorMode.Extensibility
Add custom icon parts, override SIDC icons, define label overrides, and inject new symbol parts without forking the library.
TypeScript Support
Ships with a bundled
index.d.ts declaration file. The SymbolOptions interface is augmentable for typed custom extensions.Framework Integrations
Works with Angular, Cesium, D3, Leaflet, OpenLayers, Node.js, and even Java’s ScriptEngine or Qt’s JSEngine.
Supported Standards
Military symbology is governed by two parallel families of standards: the US-led MIL-STD-2525 series and the NATO STANAG APP-6 series. milsymbol supports both.MIL-STD-2525
Published by the US Department of Defense, MIL-STD-2525 defines the symbology set for Command, Control, Communications, Computers, and Intelligence (C4I) systems. milsymbol supports:| Version | Notes |
|---|---|
| MIL-STD-2525B | Original letter-based SIDC format |
| MIL-STD-2525C | Refined letter-based SIDC; added additional symbol sets |
| MIL-STD-2525D | Introduced the 30-character number-based SIDC format |
| MIL-STD-2525E | Current version; refined icons and added suspect affiliation |
STANAG APP-6
Published by NATO, STANAG APP-6 is the alliance counterpart to MIL-STD-2525 and is closely aligned with it. milsymbol supports:| Version | Notes |
|---|---|
| STANAG APP-6 B | Letter-based SIDC; NATO equivalent of 2525C |
| STANAG APP-6 D | Number-based SIDC; NATO equivalent of 2525D |
| STANAG APP-6 E | Current version; NATO equivalent of 2525E |
Letter-Based vs. Number-Based SIDCs
Older standard versions (2525B, 2525C, APP-6 B) use a 15-character letter-based SIDC such as"SFG-UCI----D---". Newer versions (2525D/E, APP-6 D/E) use a 30-digit number-based SIDC such as "130310001412110000000000000000". milsymbol detects the format automatically and handles both.
Version 3.0 and Unified Rendering
Since version 3.0, milsymbol renders all symbology as closely as possible to MIL-STD-2525E / STANAG APP-6 E / FM 1-02.2, regardless of which SIDC format is provided. This makes symbology visually consistent across systems that use different standard versions. In cases where symbols are inconsistent between appendixes in the standard documents, milsymbol renders a consistent form for easier interpretation.How milsymbol Is Different
Most military symbology tools rely on image sprite sheets, custom fonts, or server-side rendering. milsymbol takes a different approach:- Pure JavaScript, no assets. Every symbol is constructed programmatically from JSON draw instructions that are converted to SVG paths or Canvas drawing calls. No PNG sprites, no icon fonts, no network requests.
- Fully modifiable. Fill, frame, color, size, stroke width, and icon composition can all be changed at runtime. You can even switch between APP-6 and 2525 rendering by calling
ms.setStandard("APP6"). - Modular by design. milsymbol’s internal architecture exposes icon parts, SIDC tables, label overrides, and symbol functions through a public API so that extensions can add or replace any part of the rendering pipeline without touching the core library.
- Runs anywhere JavaScript runs. Node.js, browsers, Electron, WebViews in Java and C++ applications — milsymbol has no DOM requirement for its SVG output path.
