Skip to main content
SubtitleMatrix

JSON to SMI

Or paste subtitle text

What this conversion changes

2 things are dropped or need a decision

  • Styling

    all styling except bold and italic (colour, outline, shadow, margins)

  • Karaoke

    karaoke timing (per-syllable highlighting)

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 JSON to SMI. Drop a file in — or paste the text — and you get the SMI 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: styling and karaoke have nowhere to go in SMI. 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 JSON file, converted to SMI

Input

{
  "version": 1,
  "title": "Fixture: typical",
  "fps": 25,
  "styles": {
    "Default": {
      "name": "Default",
      "fontFamily": "Arial",
      "fontSize": 20,
      "primaryColor": "#FFFFFF",
      "bold": false,
      "italic": false
    }
  },
  "generator": "subtitlematrix fixtures",
  "cues": [
    {
      "id": "1",
      "start": 0,
      "end": 2000,
      "lines": [
        "Hello world.",
        "Second line."
      ],
      "style": "Default",
      "position": {
        "x": 100,
        "y": 200,
        "align": "center"
      }
    },
    {
      "id": "2",
      "start": 2500,
      "end": 4000,
      "lines": [
        "Plain line.",
        {
          "text": "Styled line.",
          "tags": [
            {
              "kind": "italic",
              "start": 0,
              "end": 6
            }
          ]
        }
      ]
    },
    {
      "id": "3",
      "start": 4500,
      "end": 6000,
      "lines": [
        "Roger: I am here."
      ],
      "speaker": "Roger"
    }
  ]
}

Output

<SAMI>
<HEAD>
<STYLE TYPE="text/css">
<!--
P { text-align: center; font-family: Arial, sans-serif; }
-->
</STYLE>
</HEAD>
<BODY>
<SYNC Start=0>
<P>Hello world.<br>Second line.
<SYNC Start=2000>
<P>&nbsp;
<SYNC Start=2500>
<P>Plain line.<br><i>Styled</i> line.
<SYNC Start=4000>
<P>&nbsp;
<SYNC Start=4500>
<P>Roger: I am here.
<SYNC Start=6000>
<P>&nbsp;
</BODY>
</SAMI>

Dropped in this output: styling and karaoke. Everything else matches line for line.

The same conversion on an awkward input

Input

[
    { "start": 0, "end": 1000, "lines": ["First."] },
    { "start": 1000, "end": 2000, "text": "Second." },
    "not an object",
    { "start": 2000, "end": 3000, "lines": ["Third."], "class": "top" }
]

Output

<SAMI>
<HEAD>
<STYLE TYPE="text/css">
<!--
P { text-align: center; font-family: Arial, sans-serif; }
-->
</STYLE>
</HEAD>
<BODY>
<SYNC Start=0>
<P>First.
<SYNC Start=1000>
<P>&nbsp;
<SYNC Start=1000>
<P>Second.
<SYNC Start=2000>
<P>&nbsp;
<SYNC Start=2000>
<P>Third.
<SYNC Start=3000>
<P>&nbsp;
</BODY>
</SAMI>

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

Which styling survives from JSON into SMI?

Emphasis, written into the text as tags: bold, italic, underline and a colour come out as `<b>`, `<i>`, `<u>` and `<font color="…">`, which browsers act on. What the SMI file will not carry is the style table JSON relies on — the font, its size, the outline, the shadow and the margins all go, and the page embedding the subtitles styles them from its own CSS instead.

What happens to karaoke timing from JSON to SMI?

The timing goes; the words stay. Karaoke lives in the karaoke spans a JSON cue carries, which mark when each syllable lights up, and SMI has no way to record a moment inside a line — so the marks come off and the syllables arrive as ordinary SMI text.

What does the output look like when JSON becomes SMI?

Like SMI: no cue numbers and no timecode line: every cue is a `<SYNC Start=…>` tag with its text in a `<P>` under it, and — because a SYNC replaces whatever was on screen — a `<P>&nbsp;` block just after it that puts the screen back to empty. Every JSON cue becomes one SMI cue, in the same order, with the same text.

Are the JSON timings exact in the SMI file?

Yes, to the millisecond — which is as fine as either format goes. JSON writes a moment as `4126` and SMI writes the same moment as `Start=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 JSON cue come out in SMI?

As two lines with a `<br>` between them, which is how SAMI writes a hard line break. The pairing survives — the two JSON lines still belong to one subtitle in the SMI output, and a player shows them together.

Do JSON cues keep their order in the SMI 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 JSON file listed its cues out of sequence, the SMI 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 SMI back to JSON?

Yes, and it has its own list: converting SMI to JSON drops format-specific content. That list is different from the one above because the two formats keep different things.

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

No — the output is UTF-8, with Unix line endings and no byte-order mark, whatever the JSON 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 SMI.

Related tools