Tools/Printer languages/TSPL Validator

TSPL Validator

Check TSPL/TSPL2 code before sending it to a printer: unknown commands, missing fields, invalid rotation degrees and empty barcode/QR data are reported with line numbers.

Coverage: 8 commands supported, 3 partially supported, 7 recognized as printer-behaviour (not drawn). The preview renders at 203 dpi and is an interpretation of the TSPL/TSPL2 programming manual.

Paste your code

Paste code or load the sample — the result appears below, with the line and severity of each finding.

Result

LineSeverityMessage

Render your code: TSPL viewer

How to validate TSPL code

  1. Paste the TSPL job and press Validate — findings are listed with line numbers.
  2. Errors (unknown command, missing fields, empty data) mean the line will not print what you expect.
  3. Warnings (font outside the table, unsupported barcode type, rotation not 0/90/180/270) mean the preview substitutes or skips something.
  4. Info entries mark printer-behaviour commands (DENSITY, SPEED, SET) that do not affect the image.

When this is the right tool

Run it before sending TSPL to production printers, after hand-editing a job, or when a label prints blank or shifted. It checks against the same command registry the viewer renders from — what the validator accepts, the viewer can draw.

Frequently asked questions

  • Does a clean result guarantee a correct label? — No: it only means the validator's checks passed. Data-level mistakes are yours to verify — the barcode verifier can read back a printed label.
  • Why is a valid TSPL command reported as unknown? — The validator's registry equals the preview's coverage; commands outside that coverage are honestly reported instead of silently accepted.
  • Why degrees and not 0-3? — TSPL takes rotation in degrees (0/90/180/270); the 0-3 codes belong to EPL, a different language.

Save your labels to your account and print them with DirectPrint — free account. Create free account

Do the same job from code

Same engine, same result: REST API, command line, or an AI assistant over MCP. Anonymous calls work; an API key raises the quota.

RESTcurl -X POST "https://api.labelixa.com/v1/tspl/diagnostics" --data-binary @label.tspl
MCPclaude mcp add --transport http labelixa https://api.labelixa.com/mcp # tspl_validate

API reference · MCP setup · Thermal label API: ZPL, EPL, TSPL, CPCL

Run this check on every pull request with the GitHub Action