Country-flags is a collection of SVG and PNG renders of all countries' flags organized by ISO country code.
The project addresses the need for accurate, legally compliant flag imagery by maintaining renders that closely match official country and territory legislation. Source files originate from Wikimedia Commons, with contributions back to that repository when legislation reveals inaccuracies in existing renderings. Since flags exist in the public domain, the collection is free from copyright restrictions, though usage restrictions may apply in specific jurisdictions.
The tool suits projects requiring flag assets for web applications, reference materials, or data visualization. Developers can access flags through direct download, Git cloning, or NPM installation. The collection includes both SVG sources and pre-rendered PNG exports at three standard widths. For developers needing custom PNG dimensions, the project provides Node.js build scripts using svgexport and imagemin-cli, with manual conversion instructions available for those unable to run automated builds. The flags are named using 2-letter ISO-3166 country codes, with exceptions for Great Britain's constituent countries using 6-letter codes and Kosovo using the user-assigned code XK. A JSON mapping file connects ISO codes to country names.
Development activity shows consistent maintenance focused on accuracy. The project accepts contributions from users who identify discrepancies between renderings and official flag legislation. Updates to source files reflect corrections contributed back to Wikimedia Commons when inaccuracies are discovered. The codebase includes tooling for PNG generation at arbitrary dimensions, indicating ongoing attention to practical usability across different deployment scenarios.