DevTools Logo

Finetune JSONL Chat Previewer

Finetune JSONL Chat Previewer

Page through fine-tuning rows as chat transcripts with raw JSON side by side.

Runs in your browser

JSONL dataset

3 lines · 390 chars

Example 1 of 3

openai · 3 bubbles · ≈40 tokens

system

You answer tax questions in one sentence.

user

What is a p-value?

assistant

How surprising the data is if no effect exists.

{
  "messages": [
    {
      "role": "system",
      "content": "You answer tax questions in one sentence."
    },
    {
      "role": "user",
      "content": "What is a p-value?"
    },
    {
      "role": "assistant",
      "content": "How surprising the data is if no effect exists."
    }
  ]
}

Roles: system 1 · user 1 · assistant 1 · tokens use the chars/4 heuristic with chat overhead.

Details

Paste JSONL and inspect each row as a chat transcript: system, user, assistant and tool messages become color-coded bubbles, while multi-content parts and tool calls render as labeled placeholders. The previewer detects OpenAI messages, prompt/completion and ShareGPT shapes per line, shows a raw JSON pane, estimates tokens with a documented chars/4 heuristic plus chat overhead, and lets you search, jump or sample rows. Malformed lines appear as error cards instead of breaking the pager. Everything runs in your browser; the dataset is never uploaded.

More examples

OpenAI chat row

Renders three bubbles with role badges and a per-example token estimate.

Legacy prompt/completion

Shown as a user bubble followed by an assistant bubble, with a format badge.

Malformed line

An error card reports the source line number and parse position; the pager still moves to other rows.

Examples

Multi-turn chat

Input
Three OpenAI messages: system, user, assistant
Output
Three bubbles and a ≈token count including +3 per message and +3 reply priming

Role variants such as human and bot normalize to user and assistant.

Dataset search

Input
Search term 'refund' over 500 rows
Output
A count of matching rows and navigation limited to matches

Search is a literal substring comparison, so regex characters are safe.

Broken line

Input
Line 17 contains an unterminated array
Output
Error card 'Line 17: …'; other rows remain reachable

Quality review often starts with the lines a validator already flagged.

About this tool

Finetune JSONL Chat Previewer turns training rows into readable conversations. Instead of squinting at escaped JSON, you see system, user, assistant and tool messages as color-coded bubbles next to the raw record.

Format detection is per row: OpenAI messages, legacy prompt/completion, ShareGPT-style conversations, and raw-only objects all get their own badge. Text content parts are flattened, while image parts and tool calls become labeled placeholders so large payloads never flood the view.

The pager supports previous/next, direct index jumps, random sampling and literal substring search. Token numbers use a documented chars/4 heuristic plus chat-format overhead; malformed lines are shown as error cards so they cannot break navigation.

What this tool does not do

  • Large files are indexed in memory up to 100,000 rows in this browser implementation.
  • Token numbers are heuristic, not tokenizer-exact.
  • Image and audio content parts are not decoded or displayed.
  • Raw JSON view re-parses the selected line only.
  • Tool-call arguments are rendered as text, not executed or schema-validated.

How to use this tool

  1. Paste your JSONL

    One JSON object per line is enough; blank lines are skipped and a BOM is handled.

  2. Navigate the dataset

    Use prev/next, type an index, click Random sample, or search for a literal substring.

  3. Inspect a row

    Read the bubbles, role chips and token estimate; toggle the raw JSON pane for exact field values.

  4. Export a view

    Copy or download the current example as markdown when you find a row worth sharing in a bug report.

Use cases

Chat dataset QA

Spot tone, role order and truncation problems by reading conversations rather than JSON.

Bug triage

Share a specific training row as markdown when reporting a model behavior.

Format auditing

See mixed formats and malformed rows across a dataset without writing a parser.

Detected row shapes

ShapeRendering
{messages: [{role, content}]}One bubble per message, with role variants normalized.
{prompt, completion}User bubble then assistant bubble.
{conversations: [{from, value}]}ShareGPT bubbles using from/value roles.
{from, value}Single ShareGPT-style bubble.
Any other objectRaw-only card with pretty-printed JSON.
Invalid JSONError card with line number and parse position.

Array content parts are joined as text; image parts and tool_calls are summarized, never rendered inline.

Common mistakes

Mistake:Assuming one format for the whole file.

Fix:Check the per-line badge; mixed datasets are supported and highlighted.

Mistake:Treating the token estimate as exact.

Fix:It uses chars/4 plus chat overhead; run a real tokenizer for budget decisions.

Mistake:Expecting images to render.

Fix:Image parts display as labeled placeholders with a payload size estimate.

Mistake:Searching with a regex.

Fix:Search compares literal substrings, case-insensitively.

Mistake:Ignoring malformed lines.

Fix:The warning count and error cards tell you how many rows need repair before training.

Frequently asked questions

Which JSONL formats does it render?

OpenAI chat rows with a messages array, legacy prompt/completion pairs, ShareGPT conversations using from/value, single from/value rows, and plain text rows. Anything else is shown as a raw-only card. Shape detection runs per line, so one file can contain several formats without a global setting.

Does it upload my dataset?

No. The file or pasted text stays in your browser tab. Rendering, search, role normalization and token estimates are local operations, and nothing is saved when you leave the page.

How are tool calls shown?

A tool_calls entry becomes a purple bubble containing the function name and its argument string, labeled as a tool call. Arguments are displayed verbatim as text; they are not executed, parsed as code or validated against a schema. Multi-content messages with image parts show a placeholder with an approximate payload size rather than inlining base64.

Can I jump to a specific example?

Yes. Type a 1-based index in the jump field, use previous/next, click Random sample, or search for a literal substring and navigate within the matches. Out-of-range indexes are clamped instead of throwing, and malformed lines occupy their own index as error cards.

How are token counts computed?

For each bubble the tool takes ceil(text characters/4), then adds the chat-format overhead of three tokens per message plus three reply-priming tokens for chat-shaped rows. It is a transparent approximation intended for eyeballing dataset balance; use a real tokenizer such as tiktoken when you need exact context-window accounting.

What happens if a line is malformed?

That row renders as an error card with its line number and the parse error position, while the rest of the pager keeps working. A warning at the top counts all malformed rows so you know how many need fixing before training.

References & standards