ICU Message Format Tester
Enter ICU message patterns and preview formatted output with live variable substitution.
About This Tool
The ICU Message Format Tester is a free browser-based tool for testing and previewing ICU MessageFormat patterns used in internationalization (i18n). ICU MessageFormat is the industry standard for creating translatable, locale-aware messages in applications built with libraries like react-intl, FormatJS, vue-i18n, Angular i18n, and many more.
This tool parses your ICU message pattern in real time, automatically detects variables, and provides type-appropriate input fields for each one. You can test plural rules, gender selection, number formatting, date formatting, and nested messages all from a single interface. The locale selector lets you preview how your message renders in different languages, using the browser's built-in Intl API for accurate plural rules and number/date formatting.
All processing happens entirely in your browser. Your translation strings never leave your machine -- there are no server round-trips, no logging, and no third-party analytics on your input. This makes it safe for testing proprietary translation files and unreleased product strings.
If you work with structured data formats in your i18n pipeline, you may also find the JSON Formatter helpful for validating translation JSON files. For testing string escaping in translation keys, try the String Escape Tool. The Regex Tester can help you verify patterns used to extract or validate ICU placeholders in your codebase.
How to Use
- Enter your ICU message pattern in the ICU Message Pattern textarea (e.g.,
{count, plural, one {# item} other {# items}}). - The tool automatically detects all variables in your pattern and displays input fields in the Variables panel.
- Fill in variable values -- number inputs for plural/number types, date pickers for dates, and dropdowns for select arguments.
- View the live Formatted Result in the output panel on the right.
- Change the locale using the dropdown to see how plural rules and formatting differ across languages.
- Click Templates to load common ICU patterns like plurals, gender select, number formatting, and nested messages.
- Click Copy or press Ctrl+Shift+C to copy the formatted result to your clipboard.
- Review the Pattern Breakdown to understand how each part of your ICU message is parsed.
Popular ICU Message Format Examples
FAQ
Is my data safe when using this tool?
Yes. All ICU message parsing and formatting is performed client-side in your browser using JavaScript. No data is transmitted to any server. You can safely test translation strings that contain proprietary or unreleased content.
What ICU MessageFormat features are supported?
The tool supports simple arguments ({name}), number formatting ({count, number}), date and time formatting ({date, date, medium}), plural rules ({count, plural, one {# item} other {# items}}), select for categories like gender ({gender, select, male {He} female {She} other {They}}), selectordinal for ordinal numbers, and nested messages combining multiple features.
How do plural rules work across different locales?
ICU plural rules vary by language. English has two categories (one and other), while languages like Arabic have six (zero, one, two, few, many, other). This tool uses the browser's Intl.PluralRules API to apply the correct plural category for the selected locale, so you can verify that your messages handle all cases correctly.
Can I test nested ICU messages?
Yes. The parser handles nested structures like a select containing a plural inside it. For example: {gender, select, male {He has {count, plural, one {# cat} other {# cats}}} other {They have {count, plural, one {# cat} other {# cats}}}}. All variables at every nesting level are automatically detected.
Does this tool support the full ICU MessageFormat specification?
This tool covers the most commonly used subset of ICU MessageFormat: simple replacement, number, date, time, plural, select, and selectordinal. Advanced features like nested argument styles and custom skeleton date patterns use simplified fallback formatting. For production use, pair this tool with a full ICU library like FormatJS.
What is the # symbol in plural messages?
The # symbol is a special placeholder in ICU plural and selectordinal messages that gets replaced with the numeric value of the argument. For example, in {count, plural, one {# item} other {# items}}, if count is 5, the # is replaced with 5 to produce '5 items'.
How do I escape special characters in ICU messages?
Use single quotes to escape special characters. To include a literal opening brace, write '{'. To include a literal single quote, write ''. For example, 'It''s {count} o''clock' produces "It's 5 o'clock" when count is 5.
Related Tools
JSON Formatter
Format, validate, and beautify JSON with syntax highlighting and tree view.
String Escape/Unescape
Escape and unescape strings for JSON, JavaScript, HTML, URL, SQL, and CSV formats.
Regex Tester
Test regular expressions with real-time match highlighting and capture groups.
Text Case Converter
Convert text between camelCase, PascalCase, snake_case, kebab-case, and other naming conventions.
i18n Key Generator
Generate structured i18n translation keys from UI text. Supports JSON, YAML, TypeScript, XLIFF, PO/Gettext output formats.
Locale String Tester
Test JavaScript Intl API formatters with any locale. Preview NumberFormat, DateTimeFormat, ListFormat, PluralRules, Collator, and DisplayNames.