Code2Img

SQL code screenshots.

How to screenshot SQL code properly: what SQL snippets actually look like, how auto-detection behaves, the theme that reads best, and the settings that keep the card legible.

What people actually paste

SQL cards are almost always a query lifted out of an ORM log, a dashboard, or a migration — and that shows. Typical content: a WITH CTE with two named subqueries, a JOIN ladder, CASE WHEN, window functions (ROW_NUMBER() OVER (PARTITION BY …)), and one long WHERE with six AND clauses. Formatting is inconsistent because the source was a pretty-printer with its own opinion. Uppercase keywords next to lowercase column names is the normal look, and any renderer that ignores the difference makes the query read as one grey mass.

How auto-detection behaves

SQL is rule 12, ahead of JavaScript and TypeScript but behind everything for the curly-brace languages. Four triggers: a line starting SELECT, FROM followed by a word, WHERE, or JOIN — all case-insensitive. Because FROM and WHERE are English words, the rule is the most false-positive-prone in the set: a JavaScript snippet with WHERE inside a template string, or a comment saying "from the docs", can flip the whole card to SQL. The real miss is INSERT INTO … VALUES with no SELECT: no rule matches, and it falls to the typescript default. DDL (CREATE TABLE) also misses.

Theme that reads best

nord for dark: SQL has roughly three token classes (keyword, string, number) plus identifiers, and Nord's cool blues keep uppercase keywords legible without a high-saturation fight. min-light is the best light choice — maximum text contrast, no decoration, which is what a query in a runbook or ticket needs.

Three tips

Other languages

The same advice, for the languages people paste most.

How Code2Img compares

Feature by feature, against the other code screenshot tools.