How do I open and edit JSON files?
To open a JSON file, drag it into any code editor: Visual Studio Code, Sublime Text, or Notepad++ all work. To edit it, use the same editor with JSON syntax highlighting enabled, then validate the result with JSONLint or your editor's built-in formatter before deploying. An invalid JSON file fails silently at runtime, so always validate.
A JSON translation file is a plain-text, UTF-8 file with the .json extension that maps translation keys (like welcome.greeting) to translated strings. It supports nested objects, interpolation placeholders, and pluralization suffixes, all covered in detail below.
- File extension:
.json - Encoding: UTF-8 (always; non-UTF-8 files fail in most parsers)
- Format: key/value pairs, with nested objects supported
- Common pitfalls: trailing commas, single quotes, and unescaped
"inside strings, all invalid in JSON
How JSON translation files work
In a typical i18n setup, each language has its own JSON file (for example en/common.json, de/common.json). Translation keys map to translated strings, with placeholders for runtime values:
{
"greeting": "Hello, {{name}}!",
"items_one": "You have one item.",
"items_other": "You have {{count}} items."
}The {{name}} syntax is i18next interpolation. The _one / _other suffixes are i18next JSON v4 plural forms, and the framework picks the right key based on the active language's CLDR plural rules.
If you're managing translations across many languages or with a team, a translation editor like Locize replaces per-file editing with a CAT-style UI, version history, and review workflow, while still exporting the same JSON files for your build.
Recommended editors
For local editing:
- VS Code: best free option; built-in JSON validation, auto-formatting (Shift+Alt+F), and extensions like i18n Ally surface translation status across languages.
- Notepad++ (Windows): lightweight, with the JSON Viewer plugin for tree-view editing.
- Sublime Text: fast, with the Pretty JSON package for formatting and validation.
For browser-based editing without installing anything:
- translate.i18next.com: free online editor for i18next JSON files.
- JSONLint: paste, validate, format.
Text editor vs translation management system: when to upgrade
Editing JSON files directly works fine for solo projects with one or two languages. The friction shows up once you have multiple translators, multiple languages, or want to ship copy changes without redeploying. Here is what each option actually solves:
| Need | Text editor (VS Code, …) | Locize |
|---|---|---|
| 1–2 languages, solo developer | ✓ Just edit the JSON file | Overkill |
| Non-developer translators | ✗ Each edit needs a Git PR | ✓ Web UI, no Git |
| Update strings without redeploy | ✗ Requires deploy every time | ✓ CDN delivery, instant updates |
| AI auto-translation of new keys | ✗ Manual scripts | ✓ Built in, with glossary + TM context |
| Translation memory + glossary reuse | ✗ Manual | ✓ Per-project, shared across files |
| Review workflow + per-key audit log | ✗ Only Git history | ✓ Native |
| Plural / context / format validation | ✗ Only syntax-level validation | ✓ Semantic, checks against i18next plural rules |
How to edit JSON translation files in Locize
If your project has more than a few languages, more than one translator, or strict review requirements, file-by-file editing becomes a bottleneck. Locize is a translation management system designed around the i18next workflow:
- Get started
- Import your JSON files
- Edit translations in the CAT view / Translation Editor
- Use bulk actions for machine translation
- Configure automatic AI/machine translation for new keys
- Export back to JSON, or pull via CDN without redeploying
Supported import/export formats are listed under File formats.
Demo video: Watch how to edit JSON files in Locize
Frequently asked questions
Drag the .json file into any code editor: VS Code, Sublime Text, Notepad++, or WebStorm. On Windows you can also right-click → Open with → choose a text editor. JSON is plain text so there is no special viewer required, but an editor with JSON syntax highlighting makes nested structures readable. To open a JSON file in a browser without installing anything, paste the contents into JSONLint or translate.i18next.com.
For one-off JSON formatting and validation, JSONLint is the de-facto choice: paste, validate, format. For editing i18next-style JSON translation files in a browser, translate.i18next.com adds key/value editing with multi-language side-by-side view. For managing JSON translations across a team with review and AI translation, Locize provides a full editor in the browser plus CDN-backed publishing.
Yes, JSON is plain text, so any editor works. For comfort use one with JSON syntax highlighting and a built-in formatter: VS Code, Sublime Text, Notepad++, or WebStorm. Right-click → Format Document (in VS Code) catches trailing commas and missing quotes before they break your build.
Run it through JSONLint online, or use your editor's built-in formatter. From the command line: jq . my-file.json parses the file and exits with an error if it is invalid. CI pipelines should run this against every translation file on every commit so a single typo never reaches production.
i18next JSON v4 (introduced in i18next v21.0.0) uses CLDR plural-form suffixes (key_one, key_other, key_few, key_many, key_zero) instead of the older _plural / _0 / _1 suffixes from v3. v4 is the current default; the i18next library auto-selects the right form based on language and count.
Define one key per plural form using CLDR suffixes: items_one: "1 item", items_other: "{{count}} items". At runtime call t("items", { count: 5 }), and i18next picks the right key based on count and the active language's plural rules. Languages like Russian or Arabic have more forms (one/few/many/other) than English (one/other).
Yes. You can pre-translate keys using OpenAI, Anthropic, Google Translate, DeepL or other providers via scripts or CLI tools. For larger projects, Locize integrates AI/MT directly: bulk-translate missing keys, route brand-critical strings through human review, and use a project glossary and translation memory as context so terminology stays consistent.
Flat JSON uses dot-separated keys: "label.cancel": "Cancel". Nested JSON uses object structure: {"label": {"cancel": "Cancel"}}. Both reach the same value via t("label.cancel") in i18next. Flat is easier for translators in spreadsheets; nested is cleaner in source. Pick one and stay consistent; Locize and i18next support both.