Language
English

HTML Workspace

Format, minify, validate, and preview HTML

Input
Paste HTML code here...
Output
Result will appear here...

togotools.top technical reference

Technical reference

Beautify and preview HTML code locally in your browser. Configurable indent, attribute wrapping, and wrap length. Built-in sandboxed preview with device simulation. All processing runs client-side.

Core features

  • One-click beautify with space/tab indent and configurable width (1-8).
  • Attribute wrapping strategy: 7 modes including auto, force, force-aligned, and preserve.
  • Built-in sandboxed preview mode with desktop/mobile/tablet device width simulation.
  • Preview supports auto-refresh, open in new window, and manual refresh.
  • Syntax-highlighted code editor with real-time error validation.

Example: before and after

Beautify only changes whitespace and line breaks. Preview renders HTML in a sandboxed iframe that allows scripts but cannot access the parent page.

html
<div><p>Hello</p><span>World</span></div>

<div>
  <p>Hello</p>
  <span>World</span>
</div>

Limits

  • Based on the js-beautify HTML engine; does not support template syntax (Vue SFC, JSX).
  • Sandbox preview restricts to allow-scripts and allow-forms; no access to parent DOM or same-origin storage.
  • Device simulation adjusts iframe width only; touch events and UA strings are not emulated.

Frequently asked questions

Is the preview mode safe?

Preview renders in a sandboxed iframe with only allow-scripts and allow-forms. It cannot access the parent page DOM or same-origin cookies/storage.

Does it support Vue or React templates?

Only standard HTML beautify is supported. Vue SFC, JSX, and other template syntax may not be parsed correctly.