PLC Documentation Tool
ST Code Formatter & Image Generator
Paste IEC 61131-3 Structured Text, get it beautified and syntax-highlighted on a presentation card, and export a pixel-perfect PNG for docs, slides and posts.
Edit the code directly on the card. Nothing is uploaded: highlighting, formatting and the PNG are all built in your browser.
Questions
Frequently Asked
What does the ST code formatter do?
Paste IEC 61131-3 Structured Text and it syntax-highlights the code on a presentation-ready card, auto-indents it, normalizes keyword casing, and exports a crisp PNG at 1×, 2× or 3× for docs, slides, wikis, forum posts or LinkedIn. You can also copy the image straight to the clipboard.
Which ST syntax does the highlighter understand?
The full IEC 61131-3 core: IF/CASE/FOR/WHILE/REPEAT blocks, VAR sections, FUNCTION_BLOCK / FUNCTION / PROGRAM / METHOD declarations, standard function blocks like TON, TOF, CTU and R_TRIG, type-conversion functions (INT_TO_REAL…), time and date literals (T#5s, DT#…), typed and based literals (16#FF, INT#5), direct addresses (%IX0.0, %QW2, %MD4), (* block *) and // line comments, strings and {attribute} pragmas.
What does the Format button change?
It re-indents the code from the block structure (indenting after IF, FOR, WHILE, CASE, VAR and declaration headers and pulling END_*, UNTIL, ELSE and ELSIF back out) and applies your chosen keyword casing (UPPERCASE, lowercase, or keep as typed). Strings, comments and your tag names are never modified.
Does it work with Siemens SCL, CODESYS and TwinCAT code?
Yes. SCL and TwinCAT/CODESYS ST are dialects of IEC 61131-3 Structured Text, so the shared core highlights correctly, including CODESYS-style // comments and {attribute} pragmas. Vendor-specific library calls simply render as function calls.
How do I get a transparent PNG?
Pick “Transparent” in the Background select. The exported PNG then contains only the code window with its rounded corners, so you can drop it onto any slide or page background. Padding still controls the empty margin around the window.
Is my code uploaded anywhere?
No. The tokenizer, the formatter and the PNG renderer all run inside your browser using the canvas API. Nothing is sent to a server, so it is safe to use with proprietary machine code.
Where can I practice the logic itself, not just present it?
The free interactive ladder editor on this site runs real scan-cycle simulation in the browser. Start with the practice exercises (debounce, TOF fan, batch counter, state machines) or open the sandbox for free building with timers, counters, compares and data blocks.
