Tools / Android strings.xml ↔ JSON / CSV

Android strings.xml ↔ JSON / CSV.

Convert Android strings.xml resources, string arrays and plurals to JSON or CSV and back, with aapt escaping.

Runs in your browser

Ctrl/⌘ + Enter to run · Ctrl/⌘ + Shift + C to copy the result

Result
Result
Info

About Android strings.xml ↔ JSON / CSV

Android strings.xml ↔ JSON / CSV converts the resource files under res/values into formats that translators, spreadsheets and web tools understand, and turns the edited result back into a strings.xml Android Studio accepts. Plain strings become key and value pairs, string-array resources become lists and plurals become objects keyed by quantity, such as one and other. The CSV export has one row per string, array item or plural form, with name, type, item, value, comment and translatable columns, so the XML comment above a string travels with it as context and translatable="false" entries can be filtered out. The tricky part of strings.xml is escaping, and the converter applies the same rules as aapt2. When reading, \' and \" become plain quotes, \n becomes a line break, é becomes é, runs of whitespace collapse to one space and text inside double quotes keeps its spacing. When writing, apostrophes are escaped (an unescaped one is the most common reason a build fails with "Apostrophe not preceded by \"), leading @ and ? are escaped so they are not read as resource references, &, < and > become entities and values with significant spaces are wrapped in quotes. Inline markup such as <b> or <xliff:g> is kept verbatim, and the xliff namespace is declared when it is used. Other resource types like colors and dimensions are skipped and counted. Remember that each locale lives in its own values-xx folder, so convert one language file at a time. Your resources are processed in the browser only.

How to Use

  1. Paste a strings.xml file, or JSON or CSV in the documented shape.
  2. Choose the target format; auto-detection picks the source.
  3. Copy or download the result and place the XML in res/values-xx/strings.xml.

Frequently Asked Questions

How are plurals and string arrays represented?

In JSON, arrays are lists and plurals are objects such as {"one": "…", "other": "…"}. In CSV each item is a row with its index or quantity in the item column.

Why does my apostrophe break the build?

aapt2 requires apostrophes in strings.xml to be escaped as \' or the whole value to be quoted. The converter escapes them for you when writing XML.

Are HTML tags inside strings preserved?

Yes. Well-formed inline markup such as <b>, <i> or <xliff:g> is kept as-is in JSON and CSV and written back unescaped.

Is my file uploaded?

No. Conversion runs entirely in your browser.

Related Tools