Want to convert SQL to JSON lines (JSONL / NDJSON / LDJSON)?
Try Withdata Data File Converter, a desktop SQL to JSON converter for Windows, MacOS, and Linux, Convert SQL to JSON lines, Easy and Fast.
- Can run in GUI mode, Step by Step, just a few mouse clicks.
- Can run in Command line, for Scheduled Tasks and Streams.
- Convert files locally and privately, avoid uploading large SQL file(s) to online services.
JSON Lines text format (JSONL), also called Newline-delimited JSON (NDJSON), or Line-delimited JSON (LDJSON). JSON Lines files may be saved with the file extension .jsonl, *.ndjson, *.ldjson.
Convert SQL to JSON lines (JSONL / NDJSON / LDJSON)
Choose SQL file -> Set target JSON Lines (JSONL / NDJSON / LDJSON) file -> Convert SQL to JSON lines (JSONL / NDJSON / LDJSON)
Click “Start a New Convert” at task dialog.

then show the wizard.
Select source/target file type.

1. Open a SQL file.

The SQL content:

2. Config target JSON Lines (JSONL / NDJSON / LDJSON) file.

3. Set rows options.

4. Convert SQL to JSON lines (JSONL / NDJSON / LDJSON).

See JSON lines file

Convert SQL to JSON lines (JSONL / NDJSON / LDJSON) in command line
Save “SQL to JSON Lines” session, then you can:
- Convert SQL to JSON lines (JSONL / NDJSON / LDJSON) in Windows command line.
- Convert SQL to JSON lines (JSONL / NDJSON / LDJSON) in Linux command line.
- Convert SQL to JSON lines (JSONL / NDJSON / LDJSON) in macOS command line.
Set scheduled tasks for converting SQL to JSON lines (JSONL / NDJSON / LDJSON)
You can schedule and automate this converting task by:
- Save session and create .bat (Windows) or .sh (Linux/macOS) file for “SQL to JSON lines” conversion.
- Set scheduled task for “SQL to JSON lines” conversion.
FAQ
More tools for JSONL / NDJSON / LDJSON.
SQL → JSON Lines reference
Type mapping
| Value kind | in SQL | in JSON Lines |
|---|---|---|
| Int | INT | 1234 (number) |
| Bigint | BIGINT | 9007199254740993 |
| Decimal | DECIMAL(p,s) | 1234.56 (number) |
| Float | DOUBLE PRECISION | 1.234e10 (number) |
| Text | VARCHAR(n) | "text" (string) |
| Long text | TEXT / CLOB | "multi-line\ntext" |
| Date | DATE | "2026-09-18" (string) |
| Datetime | TIMESTAMP | "2026-09-18T14:30:00Z" (string) |
| Binary | BLOB / BYTEA | "base64:..." (string) |
| Boolean | BOOLEAN / SMALLINT | true / false (boolean) |
| JSON | JSON / TEXT | nested object on the same line |
Dialect differences
Both SQL and JSON Lines are file formats, so what differs below is how each one chooses to represent a value.
| Property | in SQL | in JSON Lines |
|---|---|---|
| identifiers | Two competing conventions: single-quoted literals and diale... | Double quotes; backslash escapes (a newline inside a string... |
| dates | Depends on the dialect: DATE literals, TO_DATE(), or plain ... | No date type: dates arrive as strings |
| binary | Dialect-specific: X-quoted literal, 0x hex, or decode() | Not supported natively - base64 inside a string |
| separator | Statement terminators (;) | Newline between records |
| encoding | No declaration | UTF-8 by definition |
| typing | Types belong to the target database, and they differ betwee... | Same as JSON, but records cannot nest across lines |
| shape | Statements; a dump usually means CREATE TABLE plus INSERT rows | Flat stream |
| ceiling | No formal limit, but a single INSERT statement has to fit i... | Streams, so it scales past what a single JSON document can ... |
Data File Converter without the manual work
For batch jobs, large files and scheduling use the Data File Converter converter — an offline desktop app for Windows, Linux and macOS. Free trial.
