Skip to content
100% local

PO to JSON converter

Convert a gettext .po translation catalogue to JSON, and back again.

Input
Output

PO to JSON converter

Paste a gettext .po catalogue and this tool converts every msgid/msgstr pair into a JSON object, ready to load into a JavaScript i18n library or inspect by hand. Flip the direction and it works the other way too, turning a JSON translation object back into a valid .po file. Developers use it to bridge translation-management tools that export .po with front-end stacks that expect JSON, without installing gettext tooling or writing a one-off script.

The options control the exact shape of the JSON. "Nest keys by dotted msgid" turns a flat catalogue like "nav.home" into nested objects instead of one long key. "Drop entries with an empty translation" filters out msgids nobody has translated yet. Plural forms (msgid_plural plus msgstr[0], msgstr[1]...) become either a JSON array or separate suffixed keys like key_0 and key_1. A msgctxt context, when present, can fold into the key as a context|msgid prefix so identical English strings used in different places don't collide. Comments, source references and the catalogue header (the metadata block at the top of most .po files) can each be kept or dropped.

Multi-line and concatenated string literals, escaped quotes, backslashes and newlines are handled the way gettext itself writes them, in both directions. The live tally reports how many entries are translated, untranslated and marked fuzzy, so you can gauge catalogue completeness without opening a translation editor. Very large catalogues are supported; a result that would exceed the output size limit produces a message instead of freezing the tab.

Everything runs locally in your browser — a .po file often contains a product's entire UI text, and none of it is uploaded anywhere. Copy the result, download it as a .txt file, or send it straight back into the input to convert again in the opposite direction.

FAQ

What happens to the .po header when I convert to JSON?
With "Keep the catalogue header" on, the metadata block (msgid "") is included as an object under the empty-string key. Turn it off to get only the translated strings.
How are plural forms represented?
With "Plural forms as an array" on, msgid_plural entries become a JSON array of every msgstr[n]. Turn it off and each form becomes its own key with a numeric suffix, like item_0 and item_1.
Can I round-trip a file through both directions?
Yes. Convert .po to JSON, edit the JSON, then switch direction and convert it back — the same options (nesting, msgctxt prefix, plural style) are used on both sides so the shapes match.
What counts as a "fuzzy" entry?
An entry gettext marked with the #, fuzzy flag, meaning a machine or a previous translator drafted it but it still needs review. The live tally counts these separately from translated and untranslated entries.
Is my translation catalogue uploaded anywhere?
No. The conversion runs entirely in your browser using JavaScript — your .po or JSON file never leaves your device.