Country flag icons: Free & paid resources for developers

Jakub Pomykała
Jakub Pomykała
Last updated: August 06, 20256 min read
Country flag icons: Free & paid resources for developers

Looking to add country flags to your website, app, or language selector? This 2025 update highlights the top free and paid country flag icon libraries for developers and designers. From React components and inline SVGs to emoji flags and CDN-hosted options, this guide compares the most practical solutions for modern UI projects. Each library is reviewed for integration ease, customization, and format support, helping you choose the best fit for your workflow.

I omitted projects that are just wrappers around other listed libraries as they tend to be outdated and not maintained.

Looking for a quick side-by-side comparison? Visit the country flags page to see how different libraries render flags in a real UI.

Country flag projects comparison
Country flag projects comparison

Quick overview: Flag icon options

First, let's take a look at the available options for country flag icons in 2025. Below is a table summarizing the most popular libraries and their features:

LibraryFormatReact supportCDNLicenseStyle
Flag-iconsSVG + CSS⚠️ IndirectMITClassic/Accurate
Circle-flagsSVG (Stylized)MITRound/Minimalist
FlagCDNSVG/PNG/JPG/WebPFreeBasic/Versatile
React-world-flagsInline SVGMITAccurate/Lightweight
FlagKitPNG/SVG✅ (Apple)MITHigh-res/iOS ready
WorldData GIFsGIFPaidRetro/Animated
Emoji flagsUnicode⚠️ Platform-basedFreeNative Emoji

Flag-icons: SVG flags with CSS support

Flag-icons is a collection of all country flags in SVG format, styled using CSS classes. Sourced from Wikipedia, it supports 4x3 and 1x1 aspect ratios.

flag icons project
flag icons project

Installation

You can install the library using npm:

npm install flag-icons

Usage

To use the flags in your project, you need to import the CSS file:

import "node_modules/flag-icons/css/flag-icons.min.css";

Then, you can use the flags in your HTML or JSX like this:

<span className="{`fi" fis fi-${countryCode}`} />
  • fi is the base flag class,
  • fis forces a square aspect ratio,
  • fi-{country_code} shows the country (e.g., fi-us for the USA).

Flags are identified by lowercase two-letter ISO 3166-1 alpha-2 codes ({COUNTRY_CODE}), such as fi-pl for Poland or fi-br for Brazil. This library is a great choice if you need accurate representations of flags with CSS support.

Circle-flags: Round SVG flags

Circle-flags offers a stylized set of circular SVG flags. These aren't pixel-perfect representations (they are simplified), but they work beautifully in tight UI layouts.

circle-flags project
circle-flags project

You can hotlink directly:

<img src="https://hatscripts.github.io/circle-flags/flags/us.svg" width="48">
<img src="https://hatscripts.github.io/circle-flags/flags/pl.svg" width="48">

The project uses only two-letter ISO 3166-1 codes for country codes.

Or install the package via npm:

npm install --save https://github.com/HatScripts/circle-flags

React support: react-circle-flags

The library also includes language and locale flags: language flags directory.

FlagCDN: Free hosted flag API

FlagCDN is a free content delivery network offering flags in SVG, PNG, JPG, and WebP formats. Ideal for projects needing reliable hosting without bundling images.

Flags are available in multiple sizes:

  • waving flags in 4:3 aspect ratio (e.g., 16x12, 32x24)
  • width-based flags (e.g., w20, w40, w80)
  • height-based flags (e.g., h20, h24, h40)

Example usage:

<img src="https://flagcdn.com/w80/ca.png" alt="Canada Flag">
<img src="https://flagcdn.com/32x24/pl.png" alt="Poland Flag">
FlagCDN project
FlagCDN project

React-world-flags: Inline SVG components

React-world-flags offers inline SVG rendering for country flags using a simple React component. Supports multiple country code formats: Alpha-2, Alpha-3, and numeric.

Installation:

npm install react-world-flags

Usage example:

import Flag from 'react-world-flags';
import React from 'react';

const MyComponent = () => (
  <div>
    <Flag code="us" height="16" />
    <Flag code="pl" height="16" />
  </div>
);

This renders flags as inline SVGs with no external CSS or CDN needed, ensuring they scale well and look sharp on all devices. The height prop allows you to control the size easily.

React World Flags
React World Flags

FlagKit: High-res icons for iOS & web

FlagKit offers beautifully designed SVG and PNG flags for every country. Ideal for iOS/macOS developers thanks to its Asset Catalog and integration with Apple frameworks.

You'll get flags as individual files or bundled assets.

Flags by FlagKit for iOS developers
Flags by FlagKit for iOS developers

WorldData.info: Retro GIF flags

If your project calls for a vintage aesthetic, WorldData.info offers a set of 249 retro-styled GIF flags (190x114 pixels). You can download them for €8 and use them in your project.

These aren't modern, but they suit certain creative applications well.

WorldData retro GIF flags
WorldData retro GIF flags

Emoji flags: Unicode-based country flags

Emoji flags are supported natively by most modern systems and require no images or dependencies.

Example:

🇺🇸 🇵🇱 🇯🇵 🇧🇷

You can use them in your project by simply copying and pasting the flag from the list below. However, emoji rendering varies by platform and may display differently across devices.

Emoji flags
Emoji flags

You can fetch emoji-based country data with:

curl https://cdn.simplelocalize.io/public/v1/countries

Each entry contains a flag property you can use directly.

The JSON contains a list of countries with emoji flags in the flag property.

Choosing the right flag icon library

Each flag library serves a different use case:

When choosing a library, consider:

  • Format: SVG is best for scalability, while PNG/JPG/WebP are good for static images.
  • React support: If you're using React, look for libraries with components.
  • Customization: Some libraries allow you to style flags with CSS, while others are fixed.
  • Hosting: If you prefer not to bundle images, use a CDN like FlagCDN.
  • License: Ensure the library's license fits your project's needs.

Check out these related articles for more insights on using flags in language selectors and UI design:

Conclusion

Choosing the right flag icon set depends on your tech stack, design goals, and performance needs. This updated 2025 guide ensures you're not relying on outdated wrappers or libraries. For more details and real-world previews, check out the full flag library demo.

Jakub Pomykała
Jakub Pomykała
Founder of SimpleLocalize
Ready to say
|

Greet your customers
in their native language

Start for free
5-minute setupNo credit card required