JSON to Plist
Convert JSON to an XML property list with the Apple doctype: objects become dicts, arrays arrays, and numbers integers or reals.
What the JSON to Plist does
The value is walked once: an object becomes <dict> with a <key> before each value, an array becomes <array>, a boolean becomes <true/> or <false/>, and a number becomes <integer> when it is whole and <real> otherwise. Indentation follows the depth, so the file is readable and diffable.
A null becomes an empty <string>, which is the closest a plist has to a null and is stated here rather than hidden.
A string that was an ISO date or base64 data becomes a <string>, because JSON does not distinguish them — the page cannot know which element you meant. Very large integers beyond a plist's 64-bit range are written as reals by JavaScript's own number handling.
How to use it
Paste the JSON into the JSON box, or press Run with the example already there.
Read the Property list below: the doctype, then one dict per object with a key before each value.
Check a Property list number — a whole number is an integer and a fractional one is a real.
Worked example
Input:
{"name":"Ada","tags":["a","b"],"ok":true}
Output:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Ada</string>
<key>tags</key>
<array>
<string>a</string>
<string>b</string>
</array>
<key>ok</key>
<true/>
</dict>
</plist>
Why it runs in your browser
The result is produced on this page with JavaScript, so it works offline after the page loads and nothing you enter is sent anywhere.
A complete XML property list from your JSON: the `plist` doctype, a `dict` per object, an `array` per array, and `integer` or `real` chosen by the value.
Text is XML-escaped on the way out, so a string containing `&` or `<` stays a string and does not break the document.
What it does, and what it does not
The value is walked once: an object becomes `<dict>` with a `<key>` before each value, an array becomes `<array>`, a boolean becomes `<true/>` or `<false/>`, and a number becomes `<integer>` when it is whole and `<real>` otherwise. Indentation follows the depth, so the file is readable and diffable.
A null becomes an empty `<string>`, which is the closest a plist has to a null and is stated here rather than hidden.
A string that was an ISO date or base64 data becomes a `<string>`, because JSON does not distinguish them — the page cannot know which element you meant. Very large integers beyond a plist's 64-bit range are written as reals by JavaScript's own number handling.
How to use JSON to Plist
Paste the JSON into the JSON box, or press Run with the example already there.
Read the Property list below: the doctype, then one `dict` per object with a `key` before each value.
Check a Property list number — a whole number is an `integer` and a fractional one is a `real`.
What to Expect
Best for
- Producing a plist for a macOS or iOS tool
- Checking how a JSON shape maps to plist elements
Not ideal for
- A date or binary value, which needs its own element type
- A plist with a specific key order the JSON object lost
What this tool keeps
- Array order
- Whole numbers as integers
What may need cleanup
- Replace an empty string with `<date>` where a date was meant
- Re-order keys if a consumer requires it
Common errors
- The page refuses it: the JSON is not readable
Example use cases
- Building a preferences file from JSON
- Converting a fixture into a plist
Sample input
JSON: {"name":"Ada","tags":["a","b"],"ok":true}
Sample output
Property list: <?xml version="1.0" encoding="UTF-8"?> …
Who this is for
- macOS and iOS developers
- Anyone whose tool expects a plist
Frequently asked questions
Why is null an empty string?
A property list has no null value. An empty <string> is the closest honest representation, and the page states it rather than dropping the key.
When is a number a real?
When it is not a whole number. 1 becomes <integer>1</integer> and 1.5 becomes <real>1.5</real>, which is what a plist consumer expects.
Is the output escaped?
Yes. &, <, > and the quote are escaped inside every string and key, so text cannot terminate an element early.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.