JSON is a data format you may well come across when it’s used to store or transfer data for apps. Although it’s stored as text and can be edited in any decent text editor, it’s primarily intended to be written and read by tools and apps. Like its alternative XML, it contains pairs of names (keys in XML) and values, and arrays of those pairs. For example
“XproVer”:”2162″
assigns the string value “2162” to the object name “XproVer”. Strings are delimited by straight double-quotation marks, and names separated from values by a colon. Arrays are listed within square brackets.
JSON stands for JavaScript Object Notation, as it was devised by Douglas Crockford in 2000-01 to save and exchange data for JavaScript code, although it’s now used from all serious programming languages, as it isn’t in the slightest language-dependent. In case you’re wondering how to pronounce the name, officially it’s spoken the same as Jason of the Argonauts and Golden Fleece fame.
Swift and macOS provide API support for two main formats widely used in this context, property lists using XML, and standard JSON. Apps that serialise their data into files, and decode it back again, generally opt for one or other. JSON tends to be better suited to larger quantities of data sets, such as long lists of log entries, while in Macs property lists are most commonly encountered storing more complex data such as preferences, where they’re the platform standard. Comma-separated value (CSV) format is another alternative format more widely used for transferring tabular data such as spreadsheets.
JSON has a limited range of basic data types, including numbers (which encompass signed integers and floating point types), strings, Booleans (true or false), the null empty value and arrays. Although time and datestamps could be assembled from a group of numeric values, they’re most commonly encoded as strings.
JSON files in macOS have a UTI of public.json, an extension of json, and the MIME type of application/json. As they conform to the UTI of public.text you should find it easy to open them using any text editor, including TextEdit if you really must. Serious text editors should recognise their type and provide appropriate syntactic colouring and other aids. The App Store has a range of utilities to work with JSON, including the free JSON Editor. I also strongly recommend PreviewJSON, a QuickLook previewer from Black Pyramid Software, which generates excellent thumbnails and previews of JSON files.
If you want to test out a JSON editor, then my free log browser LogUI saves log extracts using standard JSON serialisation, although instead of using the json extension, it uses logui, so will be handled by QuickLook as plain text.
Unfortunately, macOS also uses less standard forms of JSON. Standard serialisation of log entries in LogUI generates a file containing text like
[{"composedMessage":"Couldn't connect to smc! error: 0xe00002f0",
"threadIdentifier":"691",
"sender":"thermalmonitord",
"date":"2026-01-30 12:03:00.612450+0000"},
{…}]
where line breaks have been added for readability. Each log entry is enclosed in curly brackets {} followed by a comma, and the whole series of entries is set as an array within square brackets [].
You may also encounter JSON streaming formats such as JSON Lines, where each set of name-value pairs is enclosed in curly brackets {} and separated not by a comma but a new line character, thus
{"unixTime":1768265072,
"processList":[{"process":"mediaanalysisd",
"sizeBytes":10131630}],
"type":"File Rotate"}
{…}
JSON Lines should be distinguished by the extension jsonl and a UTI of public.jsonl, and should enjoy QuickLook thumbnails and previews if you install PreviewJSON. It’s intended for situations where JSON data is streamed, so processed one set or line at a time. You’ll find it in the log statistics files saved alongside folders of log tracev3 files in macOS, which logd augments whenever it rotates log files.
Even worse is JSONised XML, which is neither JSON nor XML, but a terrible chimera of both, for example
{
ASSecstatus = (
"Controller:",
" Model Identifier: Mac13,1",
" Firmware Version: iBoot-7459.121.3",
);
MRTUpdate = "2022-04-30 16:25:57 +0000";
XPremE = 62;
}
If an app, or your own code, is struggling to decode someone else’s JSON, check using a text editor whether it’s in one of those alternative formats.
References
JSON in Wikipedia
JSON streaming in Wikipedia
