Skip to content

Standalone viewer

The core of Structile is one self-contained HTML file — no build step, no server, no dependencies. Anyone can open it directly in a browser and start working with structured data, with nothing else installed.

Get the file

structile-latest.html — download it and double-click (or file:// it) to open. It starts empty; load data from there. This is the same viewer the Python library and VS Code extension both build on, packaged as a single file for zero-install use — always the current release, refreshed automatically whenever a new one ships. What changed from release to release is in the version history.

Structile showing a nested financial dataset as packed spatial boxes, with the raw JSON source open beside it and one table detached into its own panel Click for live demo ↗ Hover for the other theme

Loading data

  • Load data… / drag-and-drop / paste a file or JSON text, or From URL… (next to Paste…) / a ?url=<api> query param on the page's own address to fetch a file from a URL instead — read exactly as if that file had been dropped, so every format below works this way too. See Bookmarklet below for the one-click version of this, and Opening files from a link for a link that opens a diff.
  • Drop a file anywhere on the page — not just on the toolbar — and any file at all, whatever its extension. What a dropped file is treated as comes from its bytes, not its name: text that parses as JSON or a Python repr just opens; other text shows its content and asks for an interpreter; and a file that isn't text (an image, an archive, a bespoke binary format) is never garbled into the page — the viewer says what it appears to be and offers Show as hex, a built-in hex/ASCII view of the bytes, or you drop an interpreter that reads them (an interpreter that rejects the file read as text gets the raw bytes as a second try, and a viewer with a built-in binary interpreter tries that on the bytes before asking). Even after choosing the hex view you can still drop the interpreter. A data file dropped together with its saved .view.json or .settings.json opens with both.
  • CSV / tab-separated text (.csv, .tsv, .tab): just drop it — nothing else needed. See CSV and tab-separated text below.
  • XML (HTML included — it's just markup too), or any other text format (INI/TOML/YAML/…): drop or paste the data together with a companion interpreter .js file that describes it — see Writing and distributing interpreters. Any other extension keeps loading as plain JSON/text, same as always.
  • Large files say so, and ask first when they'd be slow. Before parsing anything, the viewer estimates the load time from the file's size (learning this computer's speed from earlier big loads): over 1 second it shows "Loading…" while it works; over about 10 seconds it asks before loading at all, and Cancel keeps what's open. Both limits are in Settings → Large files (loadNoticeSec and loadConfirmSec, in seconds; 0 turns either off). A source text over 1 MB isn't drawn in the source pane until you click Show source — drawing it is most of what makes a big file slow.
  • Reload from disk: once a file was opened from disk, a ⟳ button sits next to its name and lights up when the file has changed since it was loaded (its tooltip says so) — click it to reload in place, no picker needed. In a diff there's one per side. This needs a Chromium-based browser (Chrome, Edge) and a file opened straight from disk; Firefox and Safari work exactly the same otherwise, just without the button.

Bookmarklet

For "I just followed a link and my browser is showing me a REST API's raw JSON response" — where downloading it and opening the viewer above is more steps than the moment deserves, and a browser extension isn't an option on a locked-down corporate machine. Drag this link to your bookmarks bar:

📦 Open in Structile

Click it while on a page showing raw JSON and it opens structile-latest.html — an always-current copy of the file above, refreshed on every release rather than pinned to one version — with ?url=<the current page's address>, which fetches and loads that URL on boot.

Try it: open bookmarklet-sample.json — that's now a page showing raw JSON — then click the bookmarklet. It should open the viewer with that data already loaded.

The catch: it's a real cross-origin fetch() from danieltuzes.pages.dev, so it only works against an API that sends CORS headers allowing that origin — most public REST APIs do, most internal/authenticated ones don't (a browser restriction, not something this viewer can waive). When it doesn't work, fall back to Paste…, which has no such restriction since it just reads whatever's already rendered in your browser tab.

Don't want the bookmarklet depending on reaching this site at all (a blocked external domain, or you'd rather not rely on someone else's uptime)? Download structile-latest.html and host that copy on any http(s) server you control — an internal static host, your own intranet — then edit the bookmarklet's v= assignment to point at that address instead. Self-hosting on the same origin as the API you're fetching from also sidesteps the CORS caveat entirely, since same- origin requests aren't subject to it.

A hosted copy of the viewer opens whatever its own address names — so "what changed in the config?" can be answered with one link that fetches both versions, reads them with their interpreter and shows the diff:

https://intranet.example/structile.html?left=https://git.example/raw/v1/app.yaml&right=https://git.example/raw/v2/app.yaml&interpreter=interpreters/generic_yaml.js
Parameter What it does
url=<address> Fetches one file and opens it exactly as if it had been dropped on the page — any format the viewer reads.
left=<address>, right=<address> Fetches both and opens them as a diff. Nothing opens unless both arrive; the message says which one didn't.
interpreter=<address> An interpreter for the data. Repeat it when the files need different ones (…&interpreter=a.js&interpreter=b.js).
format=<ext> The format of an address with no file extension, such as an API endpoint: yaml, ini, xml, …
view=split Opens the diff side by side; unified is the default.

Try it on this site's own copy: a diff of two JSON files, side by side, or a YAML file with its interpreter.

Things to know:

  • Every address must be fetchable from the page. The server holding a file has to allow CORS for the page's origin, unless it's the same origin as the page. Percent-encode an address that contains & or ? itself (JavaScript's encodeURIComponent).
  • An interpreter is code that runs inside the page. One from another site than the page waits, not even fetched, until you click Run it in the panel naming it. One from the page's own site loads straight away — keep the interpreters next to the viewer on your own host and links to it never ask.
  • An address ending in .js given as url/left/right is read as text, never run.

Working with the graph

  • { } Source (top toolbar) shows the raw file text beside the graph. With it open, clicking a key/value in the graph selects and scrolls to the matching text in the source pane, and vice versa — always for JSON/Python-repr; for any interpreted format this depends on the interpreter (see Writing and distributing interpreters) — the interpreter can tag DOM nodes or raw-text character ranges. The bundled XML/HTML interpreters opt in, and CSV gets it built in.
  • Double-click a value to edit it in place; double-click a dict's title (including a chain like telemetry/exporter/otlp) to rename it.
  • A table cell can itself hold a dict or table — shown as a small {n}/[n] symbol instead of raw JSON text; click it to open that value as a detached side panel, the same way a table's own ⧉ detach button does — works recursively too. Toggle it off in Settings -> Table windows to show raw JSON text instead (on by default).
  • Links. A value that names another dict or table in the document is a clickable link once the marker is set (linkOpen/linkClose in Settings → Special values — or declared by the interpreter, as the bundled ref_xml.js does); clicking it jumps to the target. Hovering a link shows a preview of the target right there, with three buttons in its toolbar: the chain icon shows the target in place of the link (a dashed box named by the link's key; click the chain on the box to get the link back), ⤢ pins the preview beside the link on top of everything else, and ⧉ detaches it into a side panel wired to the link with dashed lines. Each window has its own ✕. A link that points at one row of a table previews just that row. When the document has links, an Expand button in the header shows every link's target in place at once — and the links inside those, 10 levels deep (the number beside it sets the depth, or removes the limit); loops of links stop just before repeating. Editing a value inside a box shown this way edits the original object, and every other place that shows it updates too; the file keeps the link, never a copy. Open link windows and the expansion are part of a saved view.
  • Many nested dicts/tables: a dict shows only the first 20 of them, behind a "k of n nested dicts/tables hidden" banner right under its header; the banner's buttons show 100 more at a time or all of them, and following a link, a search match or a source-pane click to a hidden one reveals just that one. Both numbers (childCap, childStep) and the checkbox that turns the limit off live in Settings → Nested containers. A big view also draws only the boxes near the window and draws more as you scroll, so a click costs about the same however big the document is; tick Draw every box there to draw everything at once (printing always does). If one redraw ever draws more than 20,000 page elements, a warning in the top-right corner says so and offers a fix (warnElements sets the threshold, 0 turns it off).
  • Undo/redo (with a history dropdown), search (with regex/case options), and dirty-state dots track unsaved changes per field/ container.
  • Save asks for a destination and writes a new data file via the File System Access API where supported (with a filename prompt + download fallback elsewhere), in whichever format the data was loaded as — JSON, Python-repr, CSV/tab-separated, or the interpreter's own format through its serializeXML/serializeText. A save changes only what you edited: comments, blank lines, quoting, indentation, the way numbers are written (1.0 stays 1.0, a zip code 02134 stays 02134), key order, Windows line endings and a UTF-8 byte-order mark all stay as they were — a TOML, YAML or INI file saved through the bundled interpreters changes only the edited lines. It then opens the saved content in a clean viewer tab. The menu next to Save also holds Export JSON…, Export Python…, Export CSV… and Export Excel (tab-separated)… for the current data whatever it was loaded from (the delimited ones need a table-shaped document, and a row warns when its format can't hold your data exactly); Save as HTML…, a self-contained copy of the viewer with the data, its interpreter and the current settings inside — saved while you're editing, the copy opens normally with your edits in it, and it works for binary data too; and Save viewer with interpreter…, a copy of the viewer with the current interpreter built in and no data, which recognises that format's extension (binary formats included), so a colleague can drop matching files straight onto it with nothing else to install.
  • Every table has its own ⎘ menu: Copy as CSV, Excel-friendly tab-separated text, JSON, Markdown or the file's native format (XML, say, when an XML interpreter read it) — always the complete table, not just the rows on screen — and Download as a file in any of those same formats. Export CSV… / Export Excel… in the Save menu do the same for a whole table-shaped document, whatever format it was loaded from.
  • Settings (gear icon) controls the packing layout (column/row counts, truncation widths, etc.) and can be saved/loaded as a .settings.json file (Export settings / Load settings); a full view (settings + which boxes are collapsed/expanded/detached, which link windows are open, what the nested-container banner revealed) can be saved/loaded as a .view.json sidecar file, and reopens with its boxes arranged exactly as they were.
  • The ☰ message log (top-right, next to ?) keeps every status note and warning that popped up and faded — an interpreter's diagnostics included — with timestamps and a count of the ones you haven't read; it has a Clear button and a × to close it. Above the log, Sources says where each file and its interpreter came from (a web address or a file name, when it was read, its size). A Save as HTML… copy keeps the sources, the messages and when it was saved and opened, so a copy passed along still says where its files came from.
  • The [?] About popover shows the version and release date, the interpreter that read the current file and every interpreter built into this copy, and — under Keyboard shortcuts — every key the viewer takes for itself (listed below). Every button that has a shortcut also names it in its hover tooltip.
  • The puzzle-piece button (next to { } Source, shown whenever an interpreter read the document) opens the interpreter panel: the script's name, version and documentation links, what it can do, where it came from, and its own options as live controls — the bundled XML interpreter's scaled amounts, for instance — plus Show hints in cells, which writes the interpreter's hover hints after each value. See Hover hints and interpreter options.

Big integers (anything beyond JavaScript's ±2^53 safe range) are kept exact end-to-end — parsing, editing, saving, and search all use the original value, not a rounded display form.

Keyboard shortcuts

The same list is in the [?] popover, and each button that has a key shows it in its tooltip. Ctrl is Cmd on a Mac.

Keys What Where
Ctrl+F Search the data — in a source pane, find in its text anywhere
/ Go to the search box when not typing
Ctrl+G Go to a line in the source while a source pane shows
Ctrl+O Open a file anywhere
Ctrl+S Save — in a diff, the focused side anywhere
Ctrl+Z / Ctrl+Y Undo / redo when not typing
Esc Clear the selection; close a popup anywhere
Enter / Shift+Enter Next / previous match the search box and the find bars
Esc Clear the search; close the find bar the search box and the find bars
Ctrl+A Select all of the source, and all of it in the graph with the source pane focused
Ctrl+Home / Ctrl+End Jump to the start / end of the source with the source pane focused
Enter / Esc Go to the typed line (or line:column) / close the bar in the Go to line bar
Enter / Esc Save / cancel the edit in a double-click edit box
Ctrl+Enter Add the pasted rows in a table's paste box
← → Resize a source pane with its divider focused

Source pane

{ } Source in the toolbar opens the raw file text beside the graph (in a diff, one pane per side). Its title bar holds Edit (opens an Edit review — the original on the left, your edits on the right, with its own Save and Cancel), the jump buttons (an arrow to a bar: to the start, to the end), A− / A+ for the text size, # for line numbers (in a diff, ± beside it for the difference marks), Go to line (an arrow pointing at a line), 🔍 to find in the text (Ctrl+F while the pane is focused) and × to close the pane. In a narrow pane the buttons take a second row. Drag the divider to resize the pane (or use ← → with the divider focused); opening or resizing the pane never moves the boxes.

  • Jump to start / end: the two arrow-to-bar buttons, or Ctrl+Home / Ctrl+End with the pane's text focused, scroll to the first or the last line and put the caret there. The selection in the graph stays.
  • Text size: A− and A+ step from 8 to 32 px (12 by default). One size applies to every source pane, so a diff's two sides stay line for line, and it is remembered in this browser.
  • Line numbers: click #; the choice is remembered in this browser.
  • Go to line: the Go to line button or Ctrl+G opens a bar — type a line number, or line:column, and press Enter. A line inside a folded section is unfolded first.
  • Selection sync, both ways: clicking a key or value in the graph selects and scrolls to its text, and clicking in the source highlights the matching box or cell — always for JSON, Python-repr and CSV, and for an interpreted format whenever its interpreter opts in (every bundled XML/HTML/TOML/YAML interpreter does; see Selection sync). It keeps working after you edit and save.
  • Selecting several lines — by dragging, triple-clicking, Shift+clicking, or clicking line numbers — highlights everything they cover in the graph; a collapsed box is highlighted as it is, still collapsed. Ctrl+A selects all of the source and all of it in the graph.
  • Clicking the empty part of a line (its indentation, or around a : or ,) selects that line's own entry rather than the whole dict around it; when a click does select a whole dict or table, the source marks just its first line. Shift+click extends the selection from where you last clicked.
  • In a diff, the differences are marked: each pane marks its own side's text the way the graph marks its boxes, from the same comparison — an entry only this side has is red (left) or green (right), a changed value amber in both, a moved row or item ringed, and a difference the Flexible diff rules accept muted while "within tolerance" is shown. Hover a mark for the other side's value. Nothing is compared line by line, so a value that only moved to another line is not a change. ± in either pane's title bar, or Settings → Diff, turns the marks off and on — one switch for both panes.
  • Over 1 MB of text, the pane waits for Show source before drawing — everything else works without it.

CSV and tab-separated text

.csv, .tsv and .tab files open on their own — no interpreter, nothing to pair. A header row plus uniform data rows become a table, true/false/ null and numbers are recognized as such, and quoted fields work as RFC 4180 describes, including a quoted cell containing commas, quotes or line breaks.

Which delimiter you have is read from the file's content, not its extension, so a .csv that a spreadsheet exported with tabs opens correctly too — and Save writes back the same dialect it read.

Editing a table as text

Every table's toolbar has an ✎ button next to ⎘ Copy. It opens a box, pre-filled with that table as CSV, where you can paste a table straight out of Excel (or type one) and press Process. The result arrives as ordinary edits: the viewer switches into its review diff, so every changed cell, added row and removed row is visible — and undoable, or cancellable — before anything is saved. Pasting back exactly what you copied changes nothing at all.

The box reads whatever you paste: comma- or tab-separated, with or without a header row (without one, your table's existing column order is used). If it can't read the paste, it says why and refuses to apply it rather than mangling the table.

Comparing two files

Diff… (appears once real data is loaded) compares two files right in the browser — no install needed on either side. Click it and pick a file for the other side, or drag two files onto the page at once (which one lands on the left vs. right follows drop/selection order, shown in the diff header); the two files don't even have to be the same format — a .json against an .xml + interpreter starts a cross-format diff too. Once open, ⇄ swaps sides, and clicking a Left:/Right: name replaces just that side — unsaved edits survive both. Two pickers in the header choose the layout (Split / Unified) and the scope (Full / Compact / Ultracompact): each shows the current choice and opens a menu. Resting the pointer on a choice in the menu (or reaching it with the arrow keys) previews it; moving off or Escape goes back, a click keeps it. The i badge next to Diff is an in-app guide to the Split/Unified × Full/Compact/Ultracompact views: hover a view in it to preview it behind the guide, click to switch to it, or move away to get your view back exactly as it was. Hovering a changed number anywhere in a diff shows how much it changed, as Δ +0.003 (0.02%). The side-by-side Split view draws only what's near each pane's window, so it stays quick on big documents. With { } Source open, each side's pane marks its own text with the same colours — see Source pane.

While comparing, the toolbar's Save as HTML… keeps the whole comparison as one file — both texts (unsaved edits included), their interpreters, the settings and the view — that reopens as the same diff anywhere, with nothing installed. Its ▾ saves the left or the right file on its own, edited or not, under its own name and extension — so the two files can always be got back out of a saved comparison.

Flexible diff

A diff is exact unless told otherwise. ≈ Flexible diff in the diff header opens the rules for what should count as the same, applied live to the open comparison (the button is tinted while rules are in effect; Reset in the panel clears them all):

  • At the top, Apply these rules (off compares exactly again but keeps the rules for later) and Show differences within tolerance (≈ n).
  • Strings — Whitespace (exact / trim ends / collapse runs / ignore all), Ignore case, Ignore accents (é = e), CRLF = LF, the Unicode form (as written, NFC, or NFKC — which also makes fi = fi, ² = 2 and full-width = ASCII), and Dates within a window (1d, 2h 30m, 90s) for ISO 8601 dates and times inside strings.
  • Numbers — Treat as equal when an expression over abs (|left − right|) and rel (abs ÷ max(|left|, |right|), so swapping the sides changes nothing) holds — abs <= 1e-9 or rel <= 1e-6, or abs <= 0.01 or rel <= 1%: literals such as 0.01, 1e-6, 1% and 1bp, joined with and, or, not and parentheses — plus NaN equals NaN and −0 equals 0 (both on by default).
  • Sets, empty values & other — null, missing, "", [] and {} as equal; Ignore (regex), one regular expression matched against each value's path written as trades[0].updatedAt (whatever matches isn't compared, nor anything under it; /…/i or (?i) ignores case); Ignore list order (lists and table rows compare as multisets); Subset (what only the right side has doesn't count); Ignore case in keys and column names.
  • Rules for paths — any of the above for one path pattern (trades[*].price, **.name, $.a.b), a key or a column name, added with + Add rule. The most specific rule wins, and exact undoes the rules around it.

A difference a rule accepts is never hidden silently: the diff header counts it apart — 12 changed · ≈ 37 within tolerance — and clicking that count draws those differences too, muted with a dashed edge (the same switch as the panel's "Show differences within tolerance"). Hovering such a value says which rule accepted it. List items, set members and table rows that differ only within the rules pair with each other instead of showing as removed and added. A typo in an expression or a pattern turns the field red with the reason in its tooltip, and the comparison stays exact until it's fixed. The same rules can be set from Python with structile.diff(..., rules=...).

The comparison demo opens with rules like these: a portfolio against a recalculation of it that differs everywhere a re-run does. Here its panel is open, and the differences the rules accept are drawn, muted with a dashed edge, beside the real changes:

The Flexible diff panel open over a diff of a portfolio against a recalculation of it, with whitespace trimmed, dates within a day, numbers equal within a cent, generatedAt and runId ignored, and two path rules: venue ignoring case and quotes within one basis point. Behind it, the differences these rules accept are drawn muted with a dashed edge, next to the real changes in color Click for live demo ↗ Hover for the other theme

Current limitations

  • The viewer names a format for a fixed set of extensions beyond JSON/Python/CSV (.xml/.html/.htm/.ini/.toml/.yaml/.yml). A file under any other extension still pairs with an interpreter you drop, just under the generic text format — so a format-specific interpreter remembered from earlier in the session isn't reused for it automatically, and the viewer has no published interpreter to offer for it. The Python library and the VS Code extension name a custom extension's format outright, and a custom build resolves its own extensions with nothing to drop.
  • The paste textarea only recognizes XML-shaped raw text (no filename to infer a format from) — pairing any other format's data always goes through a file, never a paste.