LaTeX to Image
Paste a ChatGPT answer or a formula such as $\frac{a}{b}$ and this page renders it with KaTeX 0.19, then saves a PNG at 1x to 3x with a transparent or white background, an SVG file, or MathML for Word. A link with ?tex=\frac{a}{b} opens the page with that formula already drawn.
How to use
- Paste the formula or the whole ChatGPT answer. The tool picks out math written as $...$, $$...$$, \(...\) or \[...\] and ignores the text around it. A formula with no dollar signs also works.
- Check the preview. If the LaTeX is wrong, the KaTeX error appears under the box with the part it could not read.
- Choose a transparent or white background and a size of 1x, 2x or 3x.
- Press the PNG or SVG button to save the picture, or copy MathML and paste it into Word.
How it works
Rendering: KaTeX 0.19 turns each formula into HTML with its own math fonts (the same fonts and rules as TeX). Math in $$...$$ or \[...\] is drawn in display style and math in $...$ or \(...\) in inline style. Up to 20 formulas per paste are stacked in one picture.
PNG: the page reads where KaTeX placed every glyph, rule and root sign, then draws them on a canvas at 1x, 2x or 3x. It does not wrap the page in a foreignObject picture, which some browsers refuse to export or draw without fonts, so the PNG comes out the same everywhere. Text is always black, and a transparent PNG keeps its alpha channel.
SVG: the same layout is written as an SVG file. Glyphs stay as text and only the KaTeX fonts the formula uses are embedded in the file, so it looks right in browsers and slide tools that honor embedded fonts. An editor that ignores embedded fonts will show a substitute font, so use the PNG there.
MathML: KaTeX also writes a MathML version of each formula. Copying it gives a structured equation that Word and other editors can paste as an editable equation, not a picture.
FAQ
Which LaTeX delimiters does it read?
Dollar signs ($...$ and $$...$$) and the bracket forms \(...\) and \[...\] that ChatGPT uses. A dollar amount such as $5 and $10 is not treated as math. If there are no delimiters at all, the whole input is read as one formula.
Why does it show a KaTeX error?
KaTeX supports most of LaTeX math but not every package or command. The message names the command it did not understand. Common causes are an unmatched brace, a command from a package KaTeX does not include, or text outside math mode.
Can I paste the result into Word?
Use Copy MathML and paste into Word to get an editable equation. If Word pastes the text as is, paste into an equation box first. The PNG works anywhere as a picture.
Why is my PNG text black?
The picture is drawn black so it reads on a white page or a light slide. Pick a white background if the app you paste into shows transparent images on a dark background.
Is my formula sent anywhere?
No. KaTeX runs in your browser and the picture is drawn there. The KaTeX script and fonts load from this site the first time you open the page.