1. Home
  2. Developer
  3. HTML WYSIWYG Editor

HTML WYSIWYG Editor

Format text visually and get the HTML code.

Runs in your browser · No upload

Loading the editor...

Select some text, enter an address and press Apply. With no selection the address itself becomes the link text.
HTML code
Characters (no spaces)
0

The output is sanitized (DOMPurify) and keeps only allowed tags and attributes: p, br, strong, b, em, i, u, s, strike, a (href), ul, ol, li, h1 to h4, blockquote, pre, code, hr, div. Scripts, event attributes, images, tables and font or color styles are removed. For alignment only text-align is kept.

Your text is processed in your browser and never sent to a server.

How to use

  1. Type in the editing area or paste text copied from elsewhere. Pasted formatting is cleaned down to the allowed tags.
  2. Select text and use the toolbar for bold, italic, underline, strikethrough, lists, alignment and block type (paragraph, headings 1 to 3, quote, code block).
  3. For a link, select the text, enter the link address and press Apply link. With no selection the address becomes the link text.
  4. Copy the HTML code below or save it with Download .html.
  5. To edit the code by hand, switch to the HTML code view, change it, and go back to Visual; your edits are applied.

Toolbar and the tags it produces

Tool Resulting HTML
Bold, italic, underline, strikethrough <b>, <i>, <u>, <strike>
Block type <p>, <h1> to <h3>, <blockquote>, <pre>
Bulleted and numbered lists <li> inside <ul> or <ol>
Align left, center, right Only text-align, as in style="text-align: center;"
Link <a href="...">
Horizontal rule <hr>
Clear formatting, remove link Removes inline formatting or the link from the selection

This is the code produced by the browser’s built-in editing commands (execCommand), then sanitized. Browsers can use different tags for the same action, so bold may come out as <b> or <strong>.

Is the output safe

The output is sanitized with DOMPurify. Any tag or attribute not in the list below is removed, keeping only the text inside.

  • Tags kept: p, br, strong, b, em, i, u, s, strike, a, ul, ol, li, h1 to h4, blockquote, pre, code, hr, div
  • Attributes kept: href on links, and from style only text-align
  • Link addresses are accepted only when they start with http://, https://, mailto:, tel:, # or /. javascript: is removed.

So code containing <script>, event attributes like onclick, <iframe>, <img>, <table> or text color and font styles leaves none of them in the result. You can also use it as a filter before pasting code into another site. Images and tables are outside the scope of this tool.

Pasting and dragging

Rich text copied from Word, a web page or Google Docs is filtered through the allow list above. Colors, fonts and tables disappear and structure such as headings, lists, bold and links stays. To paste plain text only, use Ctrl+Shift+V. Dragging files or text into the editing area is blocked.

Frequently asked questions

Can I use the HTML in a blog or email?

Wherever HTML editing is supported, copy the code and paste it in HTML mode. Apart from alignment, formatting is expressed with plain tags and no CSS, so most editors show it similarly. Fonts and colors follow the style of the place you paste into.

Does pressing Enter create a <p>?

Yes. Enter starts a new <p> paragraph. To break the line inside the same paragraph, press Shift+Enter to insert a <br>.

Why are images and tables not supported?

Images need a file upload, and tables need their own editing controls because of their structure. This tool focuses on text formatting. For tables from Excel, use the Excel to HTML Table tool.

Can behaviour differ between browsers?

The editing relies on the browser’s built-in execCommand. The standard no longer recommends it, but all major browsers still support it. If a list or heading looks odd, you can fix it in the code view.

Related tools: HTML Beautify and Minify, HTML Validator, Markdown Preview, HTML Entity Converter, HTML to Markdown.

Your text is processed in your browser and never sent to a server.

Can't find the tool you need?

Tell us what you want to do. We build the most requested tools first.