Skip to main content

PO to MO Converter

Compile a GNU gettext .po translation source file into a binary .mo file, ready for PHP, Python, WordPress, or any gettext-based app. Runs entirely in your browser — no upload.

Input

Drop a file or browse
One file · text

Read as UTF-8 text and dropped straight into the box above.

Output

Your compiled .mo file will appear here to download.
Was this helpful?

Guides

A .po file is the human-editable half of a GNU gettext translation — plain text, one msgid/msgstr pair per string. Nothing that actually loads translations at runtime reads it directly, though: PHP, Python, glibc, and WordPress all expect the compiled binary .mo (Machine Object) format instead, normally produced by the command-line msgfmt tool. This converter does the same compile step in your browser, so you can go from .po to .mo without installing gettext or a PHP/Python toolchain.

How to use it

Paste your .po file's contents into the text box, or upload the file directly — either way, the file never leaves your browser. Click Compile to MO and download the resulting messages.mo.

What it supports

  • Multi-line strings — a msgid/msgstr split across several quoted lines is joined back together, same as msgfmt.
  • Plural formsmsgid_plural and indexed msgstr[0], msgstr[1], … are compiled into gettext's NUL-joined binary plural encoding, so ngettext()/_n() lookups work correctly.
  • Message contexts — a msgctxt is folded into the compiled key exactly as pgettext()/_x() expect.
  • Fuzzy and untranslated entries are skipped, matching msgfmt's default behavior (no --use-fuzzy). A string flagged #, fuzzy is a rough machine guess a translator hasn't confirmed — shipping it as a real translation would be worse than falling back to the original text, so it's left out of the compiled catalog rather than trusted.
  • Obsolete entries (#~-prefixed, left behind by msgmerge when a string disappears from the source) are dropped, same as a real compile.

Privacy

Everything happens client-side — parsing the .po text and assembling the binary .mo file both run in your browser. Nothing is uploaded to a server.

Why isn't my translated string showing up in the .mo file?

Check whether it's flagged #, fuzzy in the .po file. Fuzzy strings are intentionally left out of the compiled catalog (see above) — remove the fuzzy flag once you've confirmed the translation is correct, then recompile.

Does the compiled file work with WordPress?

Yes — WordPress (and any other PHP gettext/Gettext_PO consumer) reads standard .mo files. Drop the compiled file into your theme's or plugin's languages/ folder using its expected <textdomain>-<locale>.mo filename.

I need to go the other way, from a compiled .mo back to editable .po

That's a separate decompile step — a MO to PO tool is planned. In the meantime, most gettext-aware editors (Poedit, GNU gettext's own msgunfmt) can open a .mo file directly.

For editing other structured translation/config formats, see the Java Properties File Formatter.

gettextpo filemo filemsgfmttranslation filei18nl10nlocalizationwordpress translationcompile po

More ways to use this tool

REST API

curl -X POST https://api.iotools.cloud/v1/tool/po-to-mo \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "po": "#\nmsgid \"\"\nmsgstr \"\"\n\"Content-Type: text/plain; …"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `po-to-mo` tool (PO to MO Converter) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Embed widget

<iframe
  src="https://iotools.cloud/embed/po-to-mo/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="PO to MO Converter — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Cost per callFrom 5 credits

Also available with

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.