Text List to Android string-array XML

Paste one item per line and get a ready-to-use Android resource block.

Runs entirely in your browser. Nothing you enter is sent or stored.

How to use

  1. Enter the array name used in R.array.
  2. Paste your list, one item per line.
  3. Copy the XML or download it as arrays.xml.
  4. Put it under res/values/ in your Android project.

When an Android app needs a fixed list — countries, categories, spinner options — the usual place is a <string-array> in res/values. Typing <item> tags by hand for dozens of entries is tedious, and one stray apostrophe can break the build. This converter turns a plain text list, one entry per line, into a complete <resources> block you can paste into strings.xml or save as arrays.xml.

Each line is trimmed, empty lines are dropped, and lines starting with "[source" are skipped. For string-array and array, the characters & < > are written as XML entities, backslash, apostrophe and double quote get a backslash, and an item that starts with @ or ? is escaped so it is not read as a resource reference. The array name keeps only letters, digits and underscores, and a leading digit gets an underscore in front. In code you read it with getResources().getStringArray(R.array.name), or getIntArray for an integer-array.

Limits: integer-array items are copied as typed and not checked, so make sure each line is a whole number. Format placeholders such as %s or %d are left unchanged. The text you paste is processed only in this browser and is never sent or saved.

Use cases & tips

Typical uses

A common case is a settings screen: you have a spreadsheet column with "Account, Notifications, Privacy & Security, Language, Help" and need it as R.array.settings_menu for a Spinner or a list adapter. Paste the column, name the array, and the output has every item wrapped in <item> tags. The same works for country lists, sort options, onboarding titles or any list a designer sends you in a document instead of XML.

Mistakes that break the build

The classic failure is an unescaped apostrophe: "Don't stop" inside <item> makes the resource compiler fail. The converter writes it as Don\'t stop for you. Also watch the array name: it must follow Java identifier rules, so a name such as 2nd-list is changed to a safe one. For integer-array, make sure every line is a plain whole number, because those values are copied as typed.

Lists that are not one per line

Not every list arrives line by line. Use "Split by" to cut a comma-separated row like "Korea, Japan, China" into items, or switch to tab or semicolon when you paste from a spreadsheet or a CSV export. Turn on sorting and duplicate removal to clean a messy list, and add translatable="false" for values that should never be translated, such as codes or brand names.

Converting back to a list

The direction menu also works in reverse. Paste an existing arrays.xml and you get the items as plain lines, with the Android escapes removed again. This helps when you hand a list to a translator, or want to compare it with a version from the design team. Compared with editing XML by hand or using a generic text tool, this keeps both directions consistent in one place.

Frequently asked questions

Are apostrophes and quotes escaped?

Yes. Characters such as ' " & < > and a leading @ or ? are escaped so aapt compiles the resource without errors.

Which lines are skipped?

Empty lines and lines starting with "[source" are skipped, and every line is trimmed.

Can I make an integer-array?

Yes. Choose integer-array in the type menu.