Skip to the content

Hata旗

Load a native country or region flag, choose supported framing and keep each drawing’s source, author and licence.

Hata (旗) is Japanese for a flag. About the name

Contents

Explanation

Hata and the other flag sets

What hata, seven other flag sets and Twemoji each say they draw, in which formats and with which licence, and what hata does not have yet.

Most flag packages draw the same few hundred flags, so the choice is about shapes, formats, codes and licences. This page puts hata beside seven flag sets that people reach for, and beside Twemoji. Every statement about another set is taken from that set's own README, linked below, and read on 2026-11-17, except Twemoji's, read on 2026-11-27; "its README does not say" means exactly that, not that the set lacks the thing. Every statement about hata is from the README and the guides, and a test that checks the docs holds the numbers.

The sets: flag-icons, country-flag-icons, circle-flags, react-world-flags, svg-country-flags (the country-flags repository), world-flags-sprite, flagpack-core and Twemoji.

What each set draws

SetWhat its README says it containsShapes
hata519 flags: 246 of the 250 countries, the first-level regions of ten countries, 52 former countries and the dated earlier flags of some present-day oneseach flag at its own proportions, and 4:3, square and round frames that never stretch it
flag-icons"A curated collection of all country flags in SVG, plus the CSS"4:3, and a squared version (fis)
country-flag-iconsevery ISO 3166-1 country, plus EU, IC, AC, TA, XK, XA, XO, XC, BQ-BO, BQ-SA, BQ-SE, GB-ENG, GB-NIR, GB-SCT, GB-WLS and ES-CT3:2
circle-flags"A collection of circular SVG country flags"; the README also names regional files such as es-ib (the Balearic Islands) and aq-true_southround
react-world-flags"SVG flags of the world for react"its README does not say
svg-country-flags"accurate renders of all the worlds flags", named by 2-letter code, GB-ENG and the like, and XK for KosovoSVG as rendered; its README does not give a ratio
world-flags-sprite"The flags of all countries in the world in one sprite"one sprite, class f32
flagpack-core"250+ flag icons", every ISO 3166 country plus BQ-SA, BQ-BO, BQ-SE, GB-ENG, GB-SCT, GB-WLS, GB-NIRits README does not say
twemojistandard Unicode emoji recommended for general interchange; Twemoji v17.0 follows Unicode 17.0 and Emoji 17.0. Its README does not say how many of them are flagsits README does not say a flag's proportions; the default image is a 72×72 PNG, and SVG files are an asset folder

How you get a flag

SetFormats and ways to use itFramework components
hataan SVG file for each flag, a module that holds the SVG string, a data URI, the <hata-flag> element, an iframe page; the demo saves SVG, PNG and JSON in the browsertyped React, Vue, Svelte and React Native components; the element for the rest
flag-iconsCSS classes (.fi .fi-xx), SVG files, SASS with a list of the countries to includeits README names none
country-flag-iconsSVG files, JavaScript strings, CSS classes with the SVG inlined as data URLs, Unicode emoji; hasFlag and countriesReact components for every flag; an experimental one for Vue 3
circle-flagsSVG files, at an address of the form …/flags/xx.svgseparate packages for React, React Native / Expo and SolidJS, each linked from its README
react-world-flagsa React component that draws an img with the SVG inlined as a data URIReact; its README says the bundle is about 1.3 MB gzipped and points to a v2 beta
svg-country-flagsSVG files and PNG exports at 100, 250 and 1000 px wide; a JSON file from code to name; a script for other widthsits README names none
world-flags-spriteone CSS sprite, <li class="flag ar">its README names none
flagpack-coreSVG files, one import each, and a countryCodeList.jsonseparate React, Vue and Svelte packages, linked from its README
twemojitwemoji.parse replaces an emoji with an image. The default is a PNG at 72×72; an SVG is the svg folderits README names none

Codes, names and licences

SetCodes it takesNames and dataLicence its README states
hataISO 3166-1 alpha-2 and ISO 3166-2 codes (case and underscore forms are normalised), and aliases for former countriesEnglish and Japanese names, and for each flag its source, author, licence, proportions, colours and tagsMIT for the code; each flag's own licence, public domain, CC0 and a few others, listed on the formats, sizes and licences page
flag-iconsalpha-2its README does not sayits README does not say
country-flag-iconsalpha-2its README does not sayits README does not say
circle-flagsalpha-2a fixed palette of eleven colours for contributorsMIT
react-world-flagsalpha-2, alpha-3 or numericits README does not sayits README does not say
svg-country-flagsalpha-2a JSON file from code to country namesays that flags are in the public domain, and that there may be other restrictions on how a flag can be used
world-flags-spritealpha-2 or alpha-3its README does not sayits README does not say
flagpack-corealpha-2countryCodeList.jsonMIT
twemojiits README does not say a country codeits README does not sayCC-BY 4.0

Where hata has something the others' READMEs do not mention

  • The licence, author and source of every flag, kept with it and read in code (manifest(code)), and a licence page that holds only flags it can carry.
  • True proportions and frames that do not stretch. Japan is 2:3, Canada 1:2, Switzerland square; a round frame is drawn again for the circle where a crop would lose a colour.
  • Disputed and alternative flags side by side, each with a status, dates and a reason, and the flag of a date for 35 countries.
  • Colours and tags for every flag, as exact hex values and a closed list of tags, each with its source (/search, colours, tags).
  • A small core. The main entry is 4.0 kB gzipped and carries no flag, and a page pays only for the flags it imports.
  • A gallery, a builder, a quiz and a docs site in English and Japanese.
  • Names in nine more languages. Each language is its own entry, so a page pays for one: @johnmorrisdotca/hata/names/fr, /es, /de, /zh-Hans, /zh-Hant, /ko, /pt, /ar and /ru. The names are Unicode CLDR's, as Kuni ships them. English and Japanese stay in /names. A place Kuni does not name in that language is null.

What hata does not have yet, and why

Each row is a gap against one of the sets above or a thing people ask a flag set for. The ticket is on the family's board; the README's Roadmap says the same in fewer words.

Not hereWhere it is foundWhy it is not hereTicket
CSS classes and one sprite sheet (fi-xx style)flag-icons, country-flag-icons, world-flags-spritenot built yet; hata ships SVG strings and filesMODULES-1426
PNG or WebP files at set widths, and a zip of everythingsvg-country-flags (PNG 100, 250, 1000 px)the demo makes PNG in the browser; no file is shippedMODULES-1427
Lookup by alpha-3, numeric or emoji, and a flagEmojireact-world-flags, world-flags-sprite, country-flag-iconsthe lookup takes alpha-2 and subdivision codes only; the README says why it does not draw emojiMODULES-1425
Flags of organisations beyond the EU (the UN, the African Union, NATO…)an organisation's flag goes in only where its terms let an MIT package carry itMODULES-1417
Cultural, indigenous and stateless-nation flagsneeds a decision on how far to go; a page can register its own with /customMODULES-1418
Spain's and Italy's regions, and the regions of Russia, India, Portugal, the Netherlands, Indonesia, Pakistan and Ethiopiacircle-flags' README names es-ibseveral of Spain's and Italy's regional drawings are CC BY-SA, which hata does not ship (decisions)MODULES-1412, MODULES-1415
Antarctica, Western Sahara and the Caribbean Netherlands' islandscountry-flag-icons and flagpack-core carry the three BQ- islands; circle-flags' README names aq-true_southno country's official flag; to be offered as variants with no defaultMODULES-1414
Ascension, Tristan da Cunha, Abkhazia, South Ossetia, Northern Cypruscountry-flag-iconsnot ISO 3166-1 countriesMODULES-1416
Civil, state and war ensigns as kinds of one flagnot built yetMODULES-1413
Facts about a flag: adoption date, designer, what the colours meanneeds sources that can be carried under MITMODULES-1420
A dated log of flag changesnot built yetMODULES-1410
More kinds of quiz question, and a matching gamenot built yetMODULES-1424, MODULES-1419
A map to choose a flag froma recipe on Chizu is plannedMODULES-1430

Not planned: redrawn flags, anything share-alike or GPL, and Angular or Solid components (the element works there).

Which to choose

  • You need the flag as a CSS class on an element and nothing else: flag-icons or the world-flags-sprite do that today, and hata does not yet.
  • You need round icons and nothing else: circle-flags.
  • You need the right flag at the right proportions, with its licence and author, in any shape, for any country or region listed here: hata.
  • You need all of that and a PNG at 250 px: svg-country-flags has the PNG, and hata draws the SVG.

Moving from one of them is on Move to hata from another flag set.

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hata 1.31.0.