jsontoolskit.org
JSON and JSON Schema utilities, in the browser
Sign in Create free accountSign up

JSON to plist

XML plist 1.0 · binary bplist00 · output checked with plutil -lint

Turn JSON into a property list for an Info.plist, an entitlements file, a launchd job or an app's defaults. Choose the XML format, with the DOCTYPE plutil writes, or the binary bplist00 format as a real file. A plist has types JSON does not — dates, raw bytes, integers distinct from reals — and no null, so each of those is a visible choice rather than a guess. The reverse is plist → JSON.

Paste JSON to start.

How to convert JSON to a plist

  1. Paste JSON, or drop a .json file on the left pane.
  2. Choose XML for a file people will read and diff, or binary for the compact format plutil -convert binary1 produces. Binary output is shown as base64; the download is the binary file itself.
  3. Decide what happens to null, which a property list cannot hold: leave it out (the status line lists every path it dropped), write an empty string, or stop.
  4. Download the .plist. On a Mac, plutil -lint data.plist confirms it parses.

How JSON types become plist types

XML or binary

The XML format is the one in Apple's DTD: <dict>, <array>, <string>, <integer>, <real>, <true/>, <false/>, <date> and base64 <data>. Its dates are whole seconds — Apple's parser accepts exactly YYYY-MM-DDTHH:MM:SSZ — so a fractional second in your JSON is dropped in XML and kept in binary, and the status line tells you when that happened. Some characters cannot be written in XML at all, even escaped: a string containing U+0000–U+001F other than tab, newline and carriage return stops XML output with its path, and binary output carries it.

The binary format, as laid out in Apple's CFBinaryPList.c, is the eight bytes bplist00, a table of objects, a table of their offsets, and a 32-byte trailer. Strings are stored as ASCII or UTF-16, dates as a float64 count of seconds since 1 January 2001, and repeated strings — typically keys — are stored once. Before showing any output, the page reads it back with its own parser and compares every value with what you pasted.

FAQ

Why not just run plutil -convert xml1 on the JSON?

You can, for simple files. On the Mac this page was tested against, plutil stops at the first null with “Invalid object in plist for property list format”, and it leaves date-shaped strings as strings, so a conversion from JSON never produces a <date> or <data>.

Can a plist's top level be an array or a plain string?

Yes. Apple's DTD lets <plist> hold any one value, so a JSON array or even a single string converts as it is. Most things that read plists — Info.plist, launchd, user defaults — expect a dictionary, though.

Is the binary file byte-for-byte what plutil would write?

No, and it does not need to be: key order and the order objects are laid out in differ. It is the same format, it passes plutil -lint, and it reads back to the same values in plutil and in Python's plistlib, which is how it was tested.

What if my JSON has a field that is literally called $data?

Only an object whose one and only key is $data with a string value is read as bytes, and if that string is not valid base64 you get an error rather than a silent conversion. An object with $data alongside other keys stays a dictionary.

Is my JSON uploaded?

No. The converter is plain JavaScript in this page, with no library to fetch, and runs entirely in your tab.