Skip to main content
SubtitleMatrix

SSA to JSON

Format conversionSubStation Alpha (SSA)
Or paste subtitle text

What this conversion changes

1 thing is dropped or needs a decision

  • Format-specific content

    content the source format keeps outside its cues (non-cue blocks, header text, per-cue settings, commented-out events) — the target format has no place for it

This list comes from the capability matrix for these two formats, not from the particular file you loaded. A specific file may lose more if it uses features the format allows but the matrix does not model.

This page converts SSA to JSON. Drop a file in — or paste the text — and you get the JSON version back. The conversion runs entirely in your browser, so nothing is uploaded and no account is needed.

These two formats do not store the same things, and the difference is not cosmetic: format-specific content has nowhere to go in JSON. The list above comes from what the two formats can each express rather than from your file, so it is the same answer before you load anything.

One file is fine, and so is a whole season: the queue works through them in order and the results come down together as a single ZIP.

Examples

A typical SSA file, converted to JSON

Input

[Script Info]
Title: Example SSA
ScriptType: v4.00
Collisions: Normal

[V4 Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding
Style: Default,Arial,20,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,1,2,2,2,10,10,10,0,1

[Events]
Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: Marked=0,0:00:01.00,0:00:04.00,Default,,0,0,0,,Hello there.
Dialogue: Marked=0,0:00:05.00,0:00:08.00,Default,,0,0,0,,{\i1}Italic{\i0} line.
Dialogue: Marked=0,0:00:09.00,0:00:12.00,Default,,0,0,0,,Two\Nlines

Output

{
  "version": 1,
  "title": "Example SSA",
  "styles": {
    "Default": {
      "name": "Default",
      "Name": "Default",
      "Fontname": "Arial",
      "Fontsize": "20",
      "PrimaryColour": "&H00FFFFFF",
      "SecondaryColour": "&H000000FF",
      "TertiaryColour": "&H00000000",
      "BackColour": "&H00000000",
      "Bold": "0",
      "Italic": "0",
      "BorderStyle": "1",
      "Outline": "2",
      "Shadow": "2",
      "Alignment": "2",
      "MarginL": "10",
      "MarginR": "10",
      "MarginV": "10",
      "AlphaLevel": "0",
      "Encoding": "1",
      "fontFamily": "Arial",
      "fontSize": 20,
      "primaryColor": "#ffffff",
      "bold": false,
      "italic": false
    }
  },
  "cues": [
    {
      "start": 1000,
      "end": 4000,
      "lines": [
        "Hello there."
      ],
      "style": "Default"
    },
    {
      "start": 5000,
      "end": 8000,
      "lines": [
        {
          "text": "Italic line.",
          "tags": [
            {
              "kind": "italic",
              "start": 0,
              "end": 6
            }
          ]
        }
      ],
      "style": "Default"
    },
    {
      "start": 9000,
      "end": 12000,
      "lines": [
        "Two",
        "lines"
      ],
      "style": "Default"
    }
  ]
}

Dropped in this output: format-specific content. Everything else matches line for line.

The same conversion on an awkward input

Input

[Script Info]
Title: Dirty SSA
ScriptType: v4.00

[V4 Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding
Style: Default,Arial,20,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,1,2,2,2,10,10,10,0,1

[Events]
Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Comment: Marked=0,0:00:00.00,0:00:01.00,Default,,0,0,0,,not a subtitle
Dialogue: Marked=0,0:00:01.00,0:00:04.00,Default,,0,0,0,,{\b1}Bold{\b0} and {\u1}underlined{\u0}.
Dialogue: Marked=0,0:00:05.00,0:00:08.00,Default,,0,0,0,,A soft\nbreak and a {\p1}mystery{\p0} code.

Output

{
  "version": 1,
  "title": "Dirty SSA",
  "styles": {
    "Default": {
      "name": "Default",
      "Name": "Default",
      "Fontname": "Arial",
      "Fontsize": "20",
      "PrimaryColour": "&H00FFFFFF",
      "SecondaryColour": "&H000000FF",
      "TertiaryColour": "&H00000000",
      "BackColour": "&H00000000",
      "Bold": "0",
      "Italic": "0",
      "BorderStyle": "1",
      "Outline": "2",
      "Shadow": "2",
      "Alignment": "2",
      "MarginL": "10",
      "MarginR": "10",
      "MarginV": "10",
      "AlphaLevel": "0",
      "Encoding": "1",
      "fontFamily": "Arial",
      "fontSize": 20,
      "primaryColor": "#ffffff",
      "bold": false,
      "italic": false
    }
  },
  "cues": [
    {
      "start": 1000,
      "end": 4000,
      "lines": [
        {
          "text": "Bold and underlined.",
          "tags": [
            {
              "kind": "bold",
              "start": 0,
              "end": 4
            },
            {
              "kind": "underline",
              "start": 9,
              "end": 19
            }
          ]
        }
      ],
      "style": "Default"
    },
    {
      "start": 5000,
      "end": 8000,
      "lines": [
        "A soft",
        "break and a {\\p1}mystery{\\p0} code."
      ],
      "style": "Default"
    }
  ]
}

This is the kind of damage real files have — mixed line endings, stray whitespace, fields left empty. Compare it with the tidy example above to see what the parser forgives.

Frequently asked questions

What happens to SSA's `[Script Info]`, `Comment:` lines and embedded fonts in JSON?

More survives than you might expect: the title comes across, and so does the whole SSA style table — every column, including the ones this site does not model, plus the parsed font, size, colour and bold/italic flags. What JSON has no place for is the rest of `[Script Info]` (`PlayResX`, `WrapStyle`, `Collisions` and the like), event lines that are not `Dialogue:` (`Comment:`, `Picture:`, `Sound:`), and anything embedded in `[Fonts]` or `[Graphics]`. Those are dropped.

What does the output look like when SSA becomes JSON?

Like JSON: an array of cue objects, each with its own `id`, `start` and `end`. Every SSA cue becomes one JSON cue, in the same order, with the same text.

Are the SSA timings exact in the JSON file?

Yes, to the millisecond — which is as fine as either format goes. SSA writes a moment as `0:00:04.13` and JSON writes the same moment as `4126`; nothing is rounded or shifted between the two, and a cue that was on screen for 2.9 seconds still is.

How does a two-line SSA cue come out in JSON?

As two entries in the cue's `lines` array. The pairing survives — the two SSA lines still belong to one subtitle in the JSON output, and a player shows them together.

Do SSA cues keep their order in the JSON output?

Yes, and they are sorted by start time on the way — earliest first, which is how every format here expects them and how players read them. If your SSA file listed its cues out of sequence, the JSON output puts them back in order; that is a change to the file's structure rather than its content, and it is deliberate.

Can I convert the JSON back to SSA?

Yes, and it has its own list: converting JSON to SSA drops precision. That list is different from the one above because the two formats keep different things.

Does the JSON output keep the SSA file's encoding?

No — the output is UTF-8, with Unix line endings and no byte-order mark, whatever the SSA file used. A file that arrives in UTF-16, or in a Windows single-byte encoding, is decoded on the way in (the result panel says so when that happens); what comes out is always the same UTF-8 JSON.

Related tools