Query Result Formatter
Paste rows from a database query or API — JSON, CSV, or TSV — and get a tidy Markdown or ASCII table.
About this tool
Query Result Formatter turns the raw rows you get back from a database query
or an API — a JSON array, CSV, TSV, or a psql/MySQL/SQLite CLI
table — into a clean, aligned table you can paste straight into a README, an
issue, a PR, or chat.
- Auto-detect input: paste rows as-is. A leading
[or{is read as JSON, a+---+/---+---rule as a SQL shell table, a tab in the first line as TSV, otherwise CSV — or pick the format explicitly. - Reads database shell output directly: paste a
psql,mysql, orsqlite3result table and the pipe columns,+---+rules, and the(2 rows)footer are cleaned up for you. - JSON, the way query results actually look: an array of row objects becomes a table whose columns are the union of every row's keys (in first-seen order); a key missing from a row is filled with your null text. Arrays of arrays, a single row object, and arrays of scalars all work too.
- Markdown or ASCII:
markdownemits a GitHub-style pipe table (with|and newlines escaped so it stays valid);asciiemits a box-drawing+---+grid for logs, comments, or plain-text docs. - Alignment + nulls: choose left, right, or center column alignment, and set the
text that a JSON
nullor a missing value renders as (e.g.NULL).
Worked example
Input (JSON query result):
[{"id":1,"name":"Ada"},{"id":2,"name":"Linus"}]
Output (Markdown):
| id | name |
| --- | ----- |
| 1 | Ada |
| 2 | Linus |
Privacy
Everything runs in your browser via WebAssembly — your data is never uploaded. Also available from the gizza CLI and in chat.
Common uses
- Turn a
psql/BigQuery TSV dump into a Markdown table for a report or ticket. - Format a JSON API response as a readable table without hand-aligning columns.
- Drop a spreadsheet selection (tab-separated) into Markdown or a plain-text grid.
FAQ
What input formats can I paste?
A JSON array of row objects, a JSON array of arrays, a single JSON object, a JSON
array of scalars, CSV, or TSV. Leave the input format on Auto and the tool
sniffs the shape from the first characters, or choose json, csv, or tsv
explicitly if the auto guess is wrong.
Can I paste output straight from psql, mysql, or sqlite3?
Yes. Choose SQL CLI table (or leave the input on Auto — a +---+ or
---+--- rule gives it away). The border pipes, the horizontal rules, and a
trailing (N rows) / rows in set footer are stripped, and the first row is used
as the header. An empty psql cell is treated as a null and renders as your
null / missing text.
How are JSON objects with different keys handled?
The columns are the union of every row's keys, in the order they first appear.
A row that is missing one of those keys shows your null / missing text in that
cell (empty by default; set it to NULL to mark database nulls). Nested arrays and
objects are kept as compact JSON so a cell never breaks the table.
What is the difference between Markdown and ASCII output?
Markdown produces a GitHub-flavored pipe table (| a | b |) with a |---|---|
separator row — ready to paste into Markdown files, issues, or PRs; | and line
breaks inside cells are escaped so it stays valid. ASCII produces a
box-drawing grid with +---+ borders, ideal for log output, code comments, or
plain-text documents where Markdown isn't rendered.
My CSV has no header row — will the first row of data be lost?
No. Turn the First row is header toggle off and the tool generates Column 1,
Column 2, … headers, and every row (including the first) lands in the table body.
JSON arrays-of-objects always use the object keys as headers regardless of this
toggle.
What if my rows have different numbers of fields?
The table is sized to the widest row and shorter rows are padded with empty cells, so ragged CSV/TSV or uneven JSON arrays still produce a rectangular table instead of an error.
Developer & Automation Access
Run it from the terminal
Same engine as this page, headless — via the gizza CLI:
gizza tool query-result-formatter '[{"id":1,"name":"Ada"},{"id":2,"name":"Linus"}]'New to the CLI? Get gizza →
Open it by URL
Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:
https://gizza.ai/tools/query-result-formatter/?data=%5B%7B%22id%22%3A1%2C%22name%22%3A%22Ada%22%7D%2C%7B%22id%22%3A2%2C%22name%22%3A%22Linus%22%7D%5D&input_format=auto&format=markdown&header=true&align=left&null_text=e.g.%20NULLMachine-readable descriptor: tool.json — title + parameters JSON Schema for agents.
