Northern Commander

JSON, YAML, XML and property lists

JSON, YAML, XML and property list files open as a tree: open a branch to see inside it, find a name or a value, copy a value or the path to it. JSON, YAML and XML can be changed in the same tree, and only what you change is rewritten — comments, order and layout stay as they were.

A YAML file. How each value is written is said, grayed, after it; the path to the cursor is along the bottom.

What the keys do

Key JSON, YAML, XML Property lists
Enter Hands it to the application macOS opens it with The same
F3 Shows the tree Shows the tree
⇧F3 Shows its text in the text viewer Its text, or its bytes if it is binary
F4 Opens it in the tree editor, below Opens its text in the built-in editor; a binary one opens read-only

An .svg picture is XML too. It opens as a picture, and F4 hands it to the application macOS edits it with; to change it as a tree, choose XML editor in Open with…. Opening files says how to change what each key does.

Recognized by

The extension alone — a JSON file called .txt is text.

Kind Extensions
JSON .json, .jsonc, .geojson, .webmanifest
YAML .yaml, .yml
XML .xml, .xsd, .xsl, .xslt, .config, .props, .targets, .csproj, .fsproj, .vbproj, .nuspec, .pom, .resx, .xaml, .axaml, .rss, .atom, .kml, .gpx, .wsdl, .xliff, .xlf, .opf, .xib, .storyboard, .xcscheme, .sdef
Property lists .plist, .entitlements, .mobileconfig, .webloc

At a glance

KeyAction
F2Open or close everything
F5Copy value
⇧F5Copy where it is
F7Search…
F3Find next
⇧F3Find the one before
⇧F9All it says about itself

Reading the tree

A JSON or YAML file opens with as many levels showing as fit the window, a level at a time: a small file opens whole, and a large one shows its shape. The tree in the editor does the same when a file is first opened. An XML file or a property list opens at its top.

Each line is a name and its value, colored by what the value is: text in quotes in green, numbers in cyan, true and false in yellow, nothing in gray, a reference in magenta. A closed branch says how much is in it — { 3 fields }, [ 2 items ]. A closed record in a list of records shows instead the values that tell it apart from the others — { id: 7, name: "Ada", … 5 more } — as many as fit the line, the fields chosen by what is in the file: those most of the records have, and whose values differ most. Where none tell them apart, the count stays.

  • ↑ and ↓ move a line, Page Up and Page Down a screen, Home and End to the top and the bottom.
  • → opens a branch, or steps into it if it is open; ← closes it, or steps out to what holds it. Enter opens and closes.
  • F2 opens every branch, and pressed again closes them all but the top.
  • Typing a name jumps to the next line whose name starts with what you have typed, among the lines showing. ⌫ takes a letter back.
  • The band along the bottom is the path to the line — the same path ⇧F5 copies.
  • A JSON or YAML file whose top is a list of records has Show as a table: each record a row and each field a column, as a table. F5 goes back to the tree.

With the mouse, a click chooses a line, and a click on the arrow before a branch, or a double-click, opens or closes it. The wheel scrolls without moving the cursor.

The line under the tree says what is at the top, how many values there are, and how many levels deep they go.

Each kind

JSON

An open object ends on a line of its own with its closing bracket, as JSON is written.
  • Comments and a trailing comma are read rather than refused, since so many files called .json have them.
  • The path is written as $.colours.accent, with [2] for the third item of a list.
  • The file must be UTF-8.

YAML

  • How a value is written is said after it, grayed: single-quoted, double-quoted, literal or folded, and any anchor (&defaults) or tag (!!str) it has.
  • An alias is shown as *defaults, never expanded — so a merge, <<: *defaults, shows the alias rather than the values it brings.
  • A file of several documents has a branch for each, document 1, document 2.
  • Values are read as YAML 1.2 reads them: true, false, null and ~, and numbers.
  • The path is written as JSON’s is. The file must be UTF-8.

XML

Attributes have lines of their own, and every open element its end tag.
  • An element holding nothing but text, or nothing at all, is one line, attributes and all: <name>Morning sail</name>. One holding elements is a branch: its attributes on lines of their own, then what it holds, then its end tag. A closed element too long for the window gives up its attributes before it gives up saying what it holds.
  • Comments and processing instructions are shown as written, grayed.
  • A document type declaration is skipped, not read, and nothing a file names is ever fetched.
  • The path is written as /gpx/trk/trkseg/trkpt[2]/@lat: an attribute starts with @, and a number in brackets tells elements of the same name apart.
  • The encoding is the one the declaration or a byte-order mark gives.

Property lists

The path is written the way macOS's plutil command takes it.
  • All three forms are read: XML, binary, and the old text form.
  • The keys of a dictionary are in the order of their characters, capitals first — the order macOS writes them in — not the order the file has them in.
  • A date is written 2026-09-14T09:30:00Z; a real number always has a decimal point; data shows its first eight bytes and how many there are, and is copied as base 64.
  • The path is written as :CFBundleDocumentTypes:0:CFBundleTypeName, as plutil takes it.
  • A .webloc file, a saved link to a web page, is a property list.
  • The line under the tree says which form the file is in.

Finding in it

F7, or ⌘F, asks what to look for, and where:

Names, values, or both.
Find
What to look for. Its list of earlier searches is the one every search in a file shares.
Search with
text, the characters themselves; regular expression, as in the text viewer’s search; or JSONPath query, below. XML offers the first two.
In the names, In the values
Where to look: the names, the values, or both. Not shown for a JSONPath query, which already says where to look.
Match case
As in the text viewer’s search.

Find next and Find previous look through the whole tree, closed branches too, and open whatever holds the match. The search comes round at the end. F3 and ⇧F3 look again. Searching again offers what you looked for last, selected, so typing replaces it. In the tree editor, F3 keeps finding it after you change a value.

It says Searching… while it looks, and the window stays free. A pattern that takes too long is given up on, and it says The pattern took too long. The tree editor’s search is the same.

A JSONPath query

In a JSON, YAML or property list file, JSONPath query reads Find as a query in standard JSONPath. Find next goes to the first node it picks; F3 and ⇧F3 step through the rest, and the line along the bottom says which one it is: Match 2 of 5. The tree is not cut down to the matches; the branches around each match are opened. A query that does not read says what is wrong and where: Expected ] to close the [ (at character 10).

Write To pick
$ the top of the file
.name, ['name'] a member by its name
[0], [-1] an item, counting from 0: the first item is [0], the last is [-1]
[1:5], [::2] a range: items 1 to 4, or every second item
* every member or item
..name, ..* at every depth below
[?@.price < 10] the members or items a filter keeps: ==, !=, <, <=, >, >=, &&, ||, ! and brackets
length(@.name) the size of a text or list
count(@.*) how many nodes a path picks
match(@.name, 'A.*') whether text fits a regular expression as a whole
search(@.name, 'A') whether a regular expression is found anywhere in text
value(@..id) the single value a path picks

For example, $.items[?@.price < 10].name picks the name of every item under ten. A file of several YAML documents is asked the query a document at a time, and an alias is read as its name rather than followed.

Copying from it

  • F5 copies the value as it reads — text without its quotes and escapes. On a branch it copies the text the branch was written as; a binary property list has no text, and says so.
  • ⇧F5 copies the path along the bottom.

A word along the bottom says what was copied.

Changing it

F4 on a JSON, YAML or XML file opens it in the tree editor: the same tree, and every change you make is made to the file’s own text. What you did not touch stays exactly as it was written — indentation, order, comments, quotes and line endings. Each change is one step of ⌘Z.

Changing a value. Automatic reads what is typed as a number; Text would keep it text, in quotes.
Press And
Enter or a double-click Edits the value. On a branch with anything in it, opens or closes it instead
⌘N Adds a member, or an item: inside the branch you are on if it is open or empty, otherwise after the line you are on
⌘V Pastes a value copied from a tree, or JSON or YAML from anywhere, where ⌘N would add one. Among named members it asks for a name, starting from the one it was copied under
F5 Copies it to just after itself, under its name with (copy) added where it has one
F6 Renames it. A name another member already has is refused
F8 or ⌦ Takes it out
⌥↑ and ⌥↓ Moves it past the one before or after
⌘→ and ⌘← Opens and closes every branch
F4 Shows the same file as text, with the cursor on the line you were on; the same key comes back

The function keys belong to editing here: F2 saves, and copying the value is Copy value in the Tree menu. ⇧F5 copies the path.

⌘V writes what it pastes the way the file is written: at the indent of what is beside it, and on one line where that is. JSON pastes into YAML as YAML, and YAML into YAML as it was copied, comments included. Any other mix — YAML into JSON, anything from XML or a property list — is refused, and so is text that is not valid in the file’s notation. A paste is one step of ⌘Z. In the XML tree editor, ⌘V says Pasting is not available in an XML tree.

Edit value and Add ask for the value and its type:

Automatic
Reads what you type as JSON or YAML would: 12 is a number, true is true, null is nothing, and anything else is text.
Text
Keeps it text, quoted, even where it reads as a number.
Object and Array, or Mapping and Sequence in YAML
A branch. Added, it starts empty. A value changed to one goes inside it; a branch changed to the other kind keeps what it holds.
The change in the file's text. Everything else, the comments included, is as it was.

What each kind adds:

  • YAML — a value is written the plainest way that reads back as typed: quoted only where it has to be, in the quotes it already had; several lines become a literal block. A whole document in a file of several is changed in the text.
  • XML — Add chooses between an element and an attribute. Names must be ones XML allows, with any prefix declared. Text is escaped as XML needs; a new element is laid out like the ones beside it, and an empty one is written the way the file already writes them. The top element, and the declaration above it, are changed in the text. A duplicated attribute is named with -copy.
  • Property lists have no tree editor.

A file that does not parse opens on the text, at the place it breaks; if the text stops parsing as you work on it, the tree says where, and Enter goes there. While the tree is up, the editor’s commands for text — find and replace, commenting, reformatting, how the file is written — wait until you switch back to the text. The editor itself is Editing files.

What the panel lists

⇧F9 lists what is at the top, how many values there are and how deep they go, and how many of each kind — branches, text, numbers, true or false, nothing, references. An XML file counts its elements, attributes, text, comments and instructions instead, and a property list says which form it is written in.

When it will not open as a tree

  • It does not parse. The view says why, gives the line and column, and shows that line with a mark under the place. F4 shows the file.
  • It is too big. A file over 20 MB, or with more than 450,000 values, is not held as a tree, and says so.
  • It is not UTF-8. A JSON or YAML file in any other encoding is refused, and says so.

Limits

  • TOML is colored as text, but has no tree.
  • JSON is read with comments and trailing commas, and nothing else JSON5 allows.
  • Nothing is checked against a schema.
  • Aliases are never expanded, and a YAML merge is not worked out.
  • Property lists can be viewed but not changed in the tree.