Markdown Artifacts Previewer
Render LLM markdown with SVG and HTML artifacts in a locked-down sandbox, entirely in your browser.
Paste LLM output
Fenced svg and html blocks (``` or ~~~) are rendered after sanitizing. Mermaid, JSX and other languages stay as code.
Artifact previews
Paste markdown or an LLM response
Fenced svg and html artifacts get their own tab.
Examples
SVG plus mermaid
parseMarkdownArtifacts("Before\n```svg\n<svg><circle /></svg>\n```\n```mermaid\nflowchart TD\n```\nAfter"){ artifacts: [{ language: "svg", kind: "svg" }, { language: "mermaid", kind: "code" }] }Two artifacts split out while Before/After prose stays in the markdown body.
HTML fragment wrapper
parseMarkdownArtifacts("```html\n<h1>Hello</h1>\n```"){ srcdoc: "<!doctype html>...<h1>Hello</h1>..." }Bare fragments become full documents without any allow-scripts token.
About this tool
Markdown Artifacts Previewer splits LLM output with parseMarkdownArtifacts: fenced blocks become ArtifactBlock entries ({ id, language, code, kind, renderable, srcdoc }) while surrounding prose stays in the markdown body. SVG and HTML kinds are renderable with srcdoc set; mermaid, jsx, and other languages stay code-only with no srcdoc.
Previews are sandbox-safe: HTML fragments are wrapped into a complete <!doctype html> document and rendered in an iframe with sandbox="" (empty string, no allow-scripts), so scripts never execute while markup still previews.
Empty input returns { markdown: "", artifacts: [] }, and renderMarkdownToText strips headings, bold, inline code, and list markers for the prose pane — all deterministic and client-side.
How to use this tool
Paste LLM markdown
Drop mixed prose plus fenced svg, html, mermaid, or jsx blocks into the parser.
Preview renderables
Render svg and html artifacts via srcdoc in a sandbox="" iframe with no script permission.
Keep code as code
Leave mermaid diagrams and jsx components as source text — they get kind code and no srcdoc.
Use cases
Reviewing LLM-generated SVG
Isolate vector output from chat prose and preview it without executing anything.
Checking LLM HTML snippets
Wrap fragments into documents and eyeball layout in a script-free iframe.
Triaging mixed model output
Separate renderable artifacts from mermaid and jsx code that needs a different renderer.
Common mistakes
Mistake:Expecting mermaid or jsx to preview.
Fix:Only svg and html are renderable — mermaid and jsx intentionally return kind code with no srcdoc.
Mistake:Adding allow-scripts to the preview iframe.
Fix:Keep sandbox="" empty; scripts in model output must never run in the preview context.
Frequently asked questions
What does this tool do?
It splits LLM markdown with parseMarkdownArtifacts into prose plus svg/html artifacts (renderable via srcdoc) while mermaid, jsx, and other languages stay code-only.
How are previews sandboxed?
Render the srcdoc in an iframe with sandbox="" (empty string) — HTML is wrapped into a full document with no allow-scripts token, so nothing executes.
Is my pasted markdown uploaded or stored?
No. Fence parsing and text rendering run fully client-side.
Why does my mermaid or jsx block not preview?
By design only svg and html get kind svg/html with srcdoc — mermaid and jsx return kind code with renderable false and no srcdoc.
Related guides
References & standards
Related tools
.env Secret Safety Linter
Validate .env syntax and spot likely leaked credentials or placeholder secrets.
.gitattributes Generator
Build .gitattributes rules for line endings, Git LFS, GitHub linguist marks and merge drivers — with a one-line explanation for every rule.
.htaccess Generator
Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth
2D Fluid Dynamics & Particle Physics Sandbox
A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.
A/B Test Sample Size Calculator
Compute required sample size per variant and test duration from baseline conversion rate, minimum detectable effect, alpha and power.
ABA Routing Number Validator
Validate 9-digit US ABA routing numbers with 3-7-1 Mod-10 breakdown.