HTML Editor online

Code

Export

The print dialog opens with the page as it is in the preview (without scripts). Choose Save as PDF (or "Microsoft Print to PDF") as the printer. In Chrome and Edge, untick "Headers and footers" and tick "Background graphics" if the page has colors. The text in the PDF can be selected.

My documents

Click a document to open it. They are stored only in this browser - nothing is uploaded. Clearing the browser's site data removes them, so download the ones you want to keep.

AI Assistant

Any AI can write with you - ChatGPT, Claude, Gemini, Copilot.

  1. Click Copy prompt.
  2. Paste it into your AI and say what it should write.
The AI should

The document travels in the link after the “#”, which no server sees. What you paste into your AI is handled by its provider.

Save to your server

The editor can send each saved version to your own server (a webhook), so your work is kept where you want it. Nothing is sent until you enter an address here.

What your server receives

A POST request with JSON (your server must allow CORS from https://html.giit.ch):

{ "editor": "html", "event": "save", "id": "…", "name": "Home page",
  "content": "<!DOCTYPE html> …",
  "assets": { "logo.png": "data:image/png;base64,…", "style.css": "data:text/css;base64,…" },
  "updated": "2026-10-25T09:30:00.000Z" }
Embed the editor in your website
<iframe src="https://html.giit.ch/?embed=1" style="width:100%;height:80vh;border:0"></iframe>
<script>
const frame = document.querySelector('iframe');
addEventListener('message', e => {
  if (e.origin !== 'https://html.giit.ch' || e.source !== frame.contentWindow) return;
  if (e.data.type === 'htmleditor:ready')
    frame.contentWindow.postMessage({ type: 'htmleditor:load', name: 'Home page',
      content: '<!DOCTYPE html>…', assets: {} }, 'https://html.giit.ch');
  if (e.data.type === 'htmleditor:save') saveOnYourServer(e.data.content, e.data.assets);
});
</script>

Also possible: ?src=<URL of an .html file> opens a file, &webhook=<URL> saves this document there. The editor can also open in a window of its own (?embed=window), and your page can hand it its own AI prompt and a session key so the AI sends its result to your server (htmleditor:ai, htmleditor:key-request) - see "Use the editor on your own website" below the editor. Details are in llms.txt.

Help

How it works

  1. Write HTML on the left - or start with New and one of the templates. The preview shows the page as you type.
  2. Click text in the preview to edit it right there: Enter or a click elsewhere writes the change into the code (one step for Undo), Escape cancels. A click on a picture or any other element jumps to its place in the code. The element at the code cursor gets a frame in the preview.
  3. Document on the right sets title, language and description of the page; Insert has ready-made pieces (headings, lists, tables, media, form fields, meta tags); Files holds the pictures, stylesheets and fonts of the page; Outline lists the headings.
  4. Problems in the code (an unclosed <div>, a picture without alt, a missing file) are listed above the code - click one to go there.
  5. My documents (the folder button at the top left) lists every document kept in this browser.
  6. Export makes an HTML file, one HTML file with the files inside, a ZIP, a PDF (via the print dialog) or plain text. Download .html saves the code.

The preview shows HTML and CSS as the browser does, but scripts and on… attributes never run and links do not navigate - so any page is safe to open.

Keyboard shortcuts

Ctrl + B / I / U
Bold / italic / underline the selected text
Ctrl + /
Comment lines in or out (<!-- -->)
Ctrl + Enter
Show the cursor's place in the preview
Tab / Shift + Tab
Indent / outdent
Ctrl + Z / Y
Undo / redo
Ctrl + S / E
Save (download .html, or to your server) / export
Ctrl + O
My documents
Ctrl + P
Print / save as PDF

Typing > at the end of a start tag adds its end tag, and Enter between the two indents the new line. Typing </ closes the element that is open.

Write HTML online, with a live preview

The HTML Editor shows your code and the page side by side. Whatever you type appears in the preview right away - headings, lists, tables, pictures and all your CSS - and a click on anything in the preview takes you to its place in the code. You can also edit the text right in the preview. That makes it quick to build landing pages, newsletters, articles and forms without installing anything.

Everything runs in your browser. Pages are not uploaded, there is no sign-up and no advertising.

What the editor can do

Code with highlighting

Tags, attributes, entities, comments and the CSS and JavaScript inside the page in their own colors, line numbers, end tags that close by themselves, and tidy indentation at a click.

A safe live preview

The page as the browser shows it, in a frame where scripts and on… attributes never run and links do not navigate. Check it at full width, tablet or phone size.

Edit in the preview

Click a heading or a paragraph in the preview and type: the change goes into the code, with &, < and > written as entities.

Problems at a glance

Unclosed or misnested tags, unknown elements, pictures without alt, missing files and ids used twice - each with its line.

Pictures, stylesheets, fonts

Drag files into the editor and use them by name: <img src="logo.png">, <link rel="stylesheet" href="style.css">. They are kept with the page in your browser.

Export

The .html file, one HTML file with every file inside, a ZIP with the files, a PDF through the print dialog, or the plain text.

How it works

  1. Start - choose a template under "New", open an .html file or a ZIP, or paste HTML code.
  2. Write - type in the code; the preview follows. Use "Insert" for lists, tables, media and form fields.
  3. Export - save the .html, a ZIP with its files, or a PDF.

Use the editor on your own website

Any https page (and localhost) can embed the editor with an <iframe> and ?embed=1 - no sign-up, no key. Embedded, the editor hides this text and shows a Save button. There are two ways to get the document in and out.

1. Open a file from a link, save to your server

src= opens a file (your server must allow CORS), webhook= makes "Save" (Ctrl+S) send the document to that address. Add &token=… for an Authorization: Bearer … header and &auto to save after every change.

<iframe src="https://html.giit.ch/?embed=1&src=https://your-site.com/pages/offer.html&webhook=https://your-site.com/save.php"
        allow="clipboard-write" style="width:100%;height:800px;border:0"></iframe>

The webhook gets a POST with JSON { editor, event: "save", id, name, content, assets, updated }. A small PHP script that stores it:

<?php
header('Access-Control-Allow-Origin: https://html.giit.ch');
header('Access-Control-Allow-Headers: Content-Type, Authorization');
header('Access-Control-Allow-Methods: POST, OPTIONS');
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') exit;
if (($_SERVER['HTTP_AUTHORIZATION'] ?? '') !== 'Bearer SECRET') { http_response_code(403); exit; }
$d = json_decode(file_get_contents('php://input'), true);
$name = preg_replace('/[^\w\- ]/u', '_', $d['name']);
file_put_contents(__DIR__ . "/pages/$name.html", $d['content']);
echo '{"ok":true}';

2. Your page holds the document (postMessage)

The editor says htmleditor:ready, your page answers with htmleditor:load, the editor reports htmleditor:loaded, htmleditor:change on real edits and htmleditor:save when the user saves. Your page may send htmleditor:get (the current state) or htmleditor:save (press Save). Saving then goes through your own login and session.

<iframe id="ed" src="https://html.giit.ch/?embed=1" allow="clipboard-write" style="width:100%;height:800px;border:0"></iframe>
<script>
const ed = document.getElementById('ed');
const ORIGIN = 'https://html.giit.ch';

addEventListener('message', async e => {
  if (e.source !== ed.contentWindow || e.origin !== ORIGIN) return;
  const m = e.data;
  if (m.type === 'htmleditor:ready') {              // the editor is ready: hand it the document
    ed.contentWindow.postMessage({
      type: 'htmleditor:load',
      name: 'Offer',
      content: await (await fetch('/pages/offer.html')).text(),
      assets: { 'logo.png': 'data:image/png;base64,…' }   // optional files
    }, ORIGIN);
  }
  if (m.type === 'htmleditor:change') document.title = '● not saved';   // a real edit
  if (m.type === 'htmleditor:save') {               // the user clicked "Save"
    await fetch('/api/save', { method: 'POST', headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ name: m.name, content: m.content, assets: m.assets }) });
    document.title = 'Saved';
  }
});

// A save button on your own page: the answer comes as htmleditor:save
function saveNow() { ed.contentWindow.postMessage({ type: 'htmleditor:get' }, ORIGIN); }
</script>

AI Assistant inside your page: it works in the frame too. With allow="clipboard-write" on the iframe, "Copy prompt" uses the clipboard directly (otherwise the editor falls back to the old copy command, or shows the prompt to copy by hand). A link the AI sends cannot reach an editor inside another website, so the editor tells the AI and the user to paste the AI's whole answer into the editor instead - or open the editor in a window of its own.

3. In a window of its own

window.open("https://html.giit.ch/?embed=window", "htmleditor-17") opens the full editor in its own window and speaks the same messages with window.opener. Links from an AI reach it there. htmleditor:load may also carry context: { host, title, rules } - the AI prompt then says where the document belongs and follows your rules - and hook: { url, token, assets: false }, a webhook for this document only that is never stored. Closing the window with unsaved changes sends htmleditor:closing.

4. AI through your own server

Hand the editor your own prompt, an address on your site and a key for this editor session. The AI dialog then shows "Connected to" your site, what you tell the AI, and the choice change the current document or make a new one; Copy prompt puts it all together. The AI posts its result with the key to your server, and your page opens it in the editor - a new document opens separately and stays in the user's browser. One key per editor session: it stays valid while the editor is open, and only while it has none the editor asks for it with htmleditor:key-request. The editor never sends the key itself and never stores it; the address must be https on your own host or a subdomain of it.

const key = async () => (await fetch('/api/ai-key.php?doc=17')).json();   // one key per editor session
const k = await key();
ed.contentWindow.postMessage({ type: 'htmleditor:load', name: 'Offer', content, ai: {
  label: 'My Site', prompt: 'Keep the [[placeholders]]. Write in German.',
  endpoint: 'https://your-site.com/api/ai-result.php', key: k.key } }, ORIGIN);
// remember the id from htmleditor:loaded and ignore change/save/closing with another id
// only while the editor has no key:
if (m.type === 'htmleditor:key-request') { const k = await key(); ed.contentWindow.postMessage({ type: 'htmleditor:ai', key: k.key }, ORIGIN); }
// while the editor is open, tell your server every minute; closing the editor or the page voids the key
setInterval(() => fetch('/api/ai-key.php?alive=' + k.key.slice(0, 8)), 60000);
// your server has a result (polling, SSE …): target is "current" or "new"
ed.contentWindow.postMessage({ type: 'htmleditor:load', name: 'Offer', content: draft, from: 'ai', target }, ORIGIN);
<?php // api/ai-key.php - the key of this editor session of the logged-in user (your page calls it)
session_start();                                     // check that the user may edit this document
$key = bin2hex(random_bytes(24));
$_SESSION['ai'][hash('sha256', $key)] = ['doc' => (int)$_GET['doc'], 'seen' => time()];  // or in your database; ?alive= sets seen again
echo json_encode(['key' => $key]);

<?php // api/ai-result.php - the AI posts here (no CORS headers: AIs call it from a server)
$key = preg_replace('/^Bearer\s+/', '', $_SERVER['HTTP_AUTHORIZATION'] ?? '');
$row = find_key(hash('sha256', $key));               // your database: not voided, seen in the last 3 minutes
if (!$row) { http_response_code(401); exit('{"ok":false,"error":"key not valid"}'); }
$d = json_decode(file_get_contents('php://input', false, null, 0, 2000000), true);
save_draft($row['doc'], $d['content'], $d['target'] === 'new' ? 'new' : 'current');   // your page shows it with htmleditor:load
echo '{"ok":true}';

Make keys with at least 128 random bits, store only their hash, bind each to the logged-in user, the document and this editor session, make one per session, keep it valid only while your page reports the session as open, and void it when the editor or the page closes.

The whole protocol is in llms.txt - give it to an AI and it builds the connection for your system. The LaTeX Editor and the SVG Editor work the same way with the prefixes latexeditor: and svgeditor: - latex.giit.ch, svg.giit.ch.

Frequently asked questions

Is my page uploaded?

No. The editor runs entirely in your browser. Your pages and their files are never sent to a server, unless you set up a webhook to your own server yourself.

Does JavaScript run in the preview?

No. The preview shows the HTML and CSS of the page, but scripts and on… attributes never run, and links do not navigate. That keeps the editor safe with any page you open. The code keeps its scripts, so the exported page works as before.

How do I add pictures and stylesheets?

Drag or paste them into the editor, or add them in the Files tab on the right. They are stored with the page in your browser and used by their name, for example <img src="logo.png"> or <link rel="stylesheet" href="style.css">.

How do I get a PDF?

Click "Export", choose PDF and click "Print / Save as PDF". In the print dialog choose "Save as PDF" as the printer.

Where are my documents saved?

Only in your browser. Click the folder button at the top left (My documents) to open, rename, duplicate, download or delete them. Clearing your browser's site data removes them, so download the ones you want to keep - or let the editor send them to your own server ("Save to server").

Can an AI write in the HTML Editor?

Yes, any AI - ChatGPT, Claude, Gemini, Copilot or the AI in your coding tool. Click "AI Assistant", then "Copy prompt", paste it into your AI and say what it should write. The AI answers with a link; click it and the page appears in your editor. "Undo" takes every change back.

Can I use the editor on my own website?

Yes. Embed it with an iframe and exchange documents with postMessage, or let it send every saved version to your server with a webhook. See Use the editor on your own website for examples.

Does the HTML Editor cost anything?

No. The editor is free, without ads and without sign-up.