i18n Key Generator

Generate structured translation keys from English text and UI labels instantly.

About This Tool

The i18n Key Generator is a free browser-based tool that helps developers create well-structured internationalization (i18n) translation keys from English text and UI labels. Instead of manually inventing key names for every string in your application, paste your UI text and get consistent, convention-following keys generated automatically.

The tool supports three naming conventions: dot notation (common.buttons.submit), snake_case (common_buttons_submit), and camelCase (commonButtonsSubmit). You can set a namespace or scope prefix (like pages.home or components.header) to organize keys under a specific section of your translation file.

All processing happens entirely in your browser. Your text is never sent to any server -- there are no API calls, no logging, and no third-party analytics. This makes it safe for proprietary UI copy and unreleased product strings.

The generator automatically categorizes your text (buttons, labels, errors, navigation, status messages, general content) and suggests appropriate key names. You can override any suggested key with a custom name. The tool also detects key collisions, warning you when two entries would produce the same key.

Output formats include JSON (both flat and nested structures), YAML, TypeScript const exports, Java Properties files, XLIFF (the XML-based localization interchange format), and PO/Gettext (used by GNU gettext and many CMS platforms). This covers the most common translation file formats across React, Vue, Angular, Next.js, Spring Boot, Rails, Django, and WordPress projects.

The batch mode lets you paste multiple strings at once (one per line) to generate keys for an entire screen or component in seconds. Combined with the JSON Formatter for cleaning up your output or the JSON-YAML Converter for switching between formats, this tool fits naturally into any localization workflow.

How to Use

  1. Choose a naming convention (dot notation, snake_case, or camelCase) from the top panel.
  2. Optionally enter a namespace prefix (e.g. pages.settings) to scope all generated keys.
  3. Select an output format (JSON, YAML, TypeScript, Java Properties, XLIFF, or PO/Gettext).
  4. Enter your UI text in the input fields. The tool suggests a key name for each string automatically.
  5. To override a suggested key, edit the key field directly below each text input.
  6. For bulk input, click Batch Mode, paste multiple strings (one per line), and click Generate Keys.
  7. Review the output panel on the right. If key collisions are detected, a warning appears above the panels.
  8. Click Copy or use Ctrl+Shift+C to copy the output to your clipboard.

Popular i18n Key Generation Examples

View all i18n key generation examples →

FAQ

Is my data safe when using this tool?

Yes. All key generation and formatting happens client-side in your browser using JavaScript. No data is transmitted to any server. You can safely use this tool with proprietary product copy, unreleased feature strings, and internal UI text.

What naming conventions are supported?

Three conventions are supported: dot notation (common.buttons.submit), snake_case (common_buttons_submit), and camelCase (commonButtonsSubmit). You can choose the convention that matches your project's existing i18n setup.

How does the tool categorize my text?

The tool analyzes each input string and categorizes it as buttons, labels, errors, navigation, status, content, or common based on keywords and patterns. For example, 'Submit Order' is categorized as 'buttons' while 'Email is required' is categorized as 'errors'. You can always override the suggested key.

What output formats are available?

The tool supports JSON (flat keys and nested objects), YAML, TypeScript const exports, Java Properties files, XLIFF 1.2, and PO/Gettext format. These cover frameworks like react-i18next, vue-i18n, next-intl, Angular i18n, Spring Boot MessageSource, Rails I18n, and Django gettext.

What is key collision detection?

When two or more input strings generate the same translation key, the tool shows a warning with the duplicated key and the row numbers involved. This prevents accidental overwrites in your translation files where one value would silently replace another.

Can I use a custom namespace prefix?

Yes. Enter any prefix in the namespace field (e.g. 'pages.checkout' or 'components.modal'). The prefix is prepended to all generated keys, helping organize translations by page, component, or feature module.

Does the batch mode handle large inputs?

Yes. In batch mode, paste any number of strings (one per line) and click Generate Keys to process them all at once. This is useful when extracting strings from an entire page or component. The tool handles hundreds of strings without performance issues since everything runs locally.

Related Tools