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-01-15T09: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.

Scrivi HTML online, con anteprima dal vivo

L'Editor HTML mostra il tuo codice e la pagina uno accanto all'altra. Tutto ciò che scrivi appare subito nell'anteprima - titoli, elenchi, tabelle, immagini e tutto il tuo CSS - e un clic su qualsiasi cosa nell'anteprima ti porta al suo punto nel codice. Puoi anche modificare il testo direttamente nell'anteprima. Così crei in fretta landing page, newsletter, articoli e moduli senza installare nulla.

Tutto funziona nel tuo browser. Le pagine non vengono caricate, non serve registrarsi e non c'è pubblicità.

Cosa sa fare l'editor

Codice evidenziato

Tag, attributi, entità, commenti e il CSS e JavaScript della pagina nei loro colori, numeri di riga, tag di chiusura automatici e rientro ordinato con un clic.

Un'anteprima dal vivo sicura

La pagina come la mostra il browser, in un riquadro dove script e attributi on… non vengono mai eseguiti e i link non portano altrove. Controllala a larghezza piena, in formato tablet o telefono.

Modifica nell'anteprima

Fai clic su un titolo o un paragrafo nell'anteprima e scrivi: la modifica va nel codice, con &, < e > scritti come entità.

Problemi a colpo d'occhio

Tag non chiusi o annidati male, elementi sconosciuti, immagini senza alt, file mancanti e id usati due volte - ciascuno con la sua riga.

Immagini, fogli di stile, caratteri

Trascina i file nell'editor e usali per nome: <img src="../logo.png">, <link rel="stylesheet" href="../style.css">. Restano con la pagina nel tuo browser.

Esportazione

Il file .html, un unico file HTML con tutti i file incorporati, uno ZIP con i file, un PDF tramite la finestra di stampa, o il testo semplice.

Come funziona

  1. Inizia - scegli un modello in «Nuovo», apri un file .html o uno ZIP, oppure incolla codice HTML.
  2. Scrivi - digita nel codice; l'anteprima segue. Usa «Inserisci» per elenchi, tabelle, media e campi di modulo.
  3. Esporta - salva il file .html, uno ZIP con i suoi file, o un PDF.

Usare l'editor sul tuo sito web

Qualsiasi pagina https (e localhost) può integrare l'editor con un <iframe> e ?embed=1 - senza registrazione, senza chiave. Integrato, l'editor nasconde questo testo e mostra un pulsante Salva. Ci sono due modi per far entrare e uscire il documento.

1. Aprire un file da un link, salvare sul tuo server

src= apre un file (il tuo server deve consentire CORS), webhook= fa sì che «Salva» (Ctrl+S) invii il documento a quell'indirizzo. Aggiungi &token=… per un'intestazione Authorization: Bearer … e &auto per salvare dopo ogni modifica.

<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>

Il webhook riceve un POST con JSON { editor, event: "save", id, name, content, assets, updated }. Un piccolo script PHP che lo salva:

<?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. La tua pagina custodisce il documento (postMessage)

L'editor dice htmleditor:ready, la tua pagina risponde con htmleditor:load, l'editor segnala htmleditor:loaded, htmleditor:change alle modifiche reali e htmleditor:save quando l'utente salva. La tua pagina può inviare htmleditor:get (lo stato attuale) o htmleditor:save (premi Salva). Il salvataggio passa così dal tuo login e dalla tua sessione.

<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') {              // l'editor è pronto: passagli il documento
    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';   // una modifica reale
  if (m.type === 'htmleditor:save') {               // l'utente ha fatto clic su "Salva"
    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';
  }
});

// Un pulsante Salva sulla tua pagina: la risposta arriva come htmleditor:save
function saveNow() { ed.contentWindow.postMessage({ type: 'htmleditor:get' }, ORIGIN); }
</script>

Assistente IA nella tua pagina: funziona anche nel riquadro. Con allow="clipboard-write" sull'iframe, «Copia il prompt» usa direttamente gli appunti (altrimenti l'editor ricorre al vecchio comando di copia, o mostra il prompt da copiare a mano). Un link inviato dall'IA non può raggiungere un editor dentro un altro sito web, quindi l'editor dice all'IA e all'utente di incollare invece l'intera risposta dell'IA nell'editor - oppure di aprire l'editor in una finestra propria.

3. In una finestra propria

window.open("https://html.giit.ch/?embed=window", "htmleditor-17") apre l'editor completo in una finestra propria e usa gli stessi messaggi con window.opener. Lì lo raggiungono i link di un'IA. htmleditor:load può portare anche context: { host, title, rules } - il prompt per l'IA dice allora a chi appartiene il documento e segue le tue regole - e hook: { url, token, assets: false }, un webhook solo per questo documento che non viene mai salvato. Chiudere la finestra con modifiche non salvate invia htmleditor:closing.

4. IA tramite il tuo server

Passa all'editor il tuo prompt, un indirizzo sul tuo sito e una chiave per questa sessione dell'editor. La finestra dell'IA mostra allora «Connesso a» il tuo sito, ciò che dici all'IA e la scelta modificare il documento attuale o crearne uno nuovo; Copia il prompt mette tutto insieme. L'IA invia il risultato con la chiave al tuo server, e la tua pagina lo apre nell'editor - un nuovo documento si apre separatamente e resta nel browser dell'utente. Una chiave per sessione dell'editor: resta valida finché l'editor è aperto, e solo finché non ne ha una l'editor la chiede con htmleditor:key-request. L'editor non invia mai la chiave di sua iniziativa e non la salva mai; l'indirizzo deve essere https sul tuo host o su un suo sottodominio.

const key = async () => (await fetch('/api/ai-key.php?doc=17')).json();   // una chiave per sessione dell'editor
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);
// ricorda l'id da htmleditor:loaded e ignora change/save/closing con un altro id
// solo finché l'editor non ha una chiave:
if (m.type === 'htmleditor:key-request') { const k = await key(); ed.contentWindow.postMessage({ type: 'htmleditor:ai', key: k.key }, ORIGIN); }
// finché l'editor è aperto, avvisa il tuo server ogni minuto; chiudere l'editor o la pagina annulla la chiave
setInterval(() => fetch('/api/ai-key.php?alive=' + k.key.slice(0, 8)), 60000);
// il tuo server ha un risultato (polling, SSE …): target è "current" o "new"
ed.contentWindow.postMessage({ type: 'htmleditor:load', name: 'Offer', content: draft, from: 'ai', target }, ORIGIN);
<?php // api/ai-key.php - la chiave di questa sessione dell'editor dell'utente connesso (la chiama la tua pagina)
session_start();                                     // verifica che l'utente possa modificare questo documento
$key = bin2hex(random_bytes(24));
$_SESSION['ai'][hash('sha256', $key)] = ['doc' => (int)$_GET['doc'], 'seen' => time()];  // o nel tuo database; ?alive= aggiorna seen
echo json_encode(['key' => $key]);

<?php // api/ai-result.php - l'IA invia qui (niente intestazioni CORS: le IA lo chiamano da un server)
$key = preg_replace('/^Bearer\s+/', '', $_SERVER['HTTP_AUTHORIZATION'] ?? '');
$row = find_key(hash('sha256', $key));               // il tuo database: non annullata, vista negli ultimi 3 minuti
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');   // la tua pagina lo mostra con htmleditor:load
echo '{"ok":true}';

Crea chiavi con almeno 128 bit casuali, salvane solo l'hash, lega ciascuna all'utente connesso, al documento e a questa sessione dell'editor, creane una per sessione, mantienila valida solo finché la tua pagina segnala la sessione come aperta, e annullala quando l'editor o la pagina si chiude.

L'intero protocollo è in llms.txt - dallo a un'IA e costruirà il collegamento per il tuo sistema. L'Editor LaTeX e l'Editor SVG funzionano allo stesso modo con i prefissi latexeditor: e svgeditor: - latex.giit.ch, svg.giit.ch.

Domande frequenti

La mia pagina viene caricata?

No. L'editor funziona interamente nel tuo browser. Le tue pagine e i loro file non vengono mai inviati a un server, a meno che tu stesso non configuri un webhook verso il tuo server.

JavaScript viene eseguito nell'anteprima?

No. L'anteprima mostra l'HTML e il CSS della pagina, ma script e attributi on… non vengono mai eseguiti, e i link non portano altrove. Così l'editor resta sicuro con qualsiasi pagina tu apra. Il codice mantiene i suoi script, quindi la pagina esportata funziona come prima.

Come aggiungo immagini e fogli di stile?

Trascinali o incollali nell'editor, oppure aggiungili nella scheda File a destra. Vengono salvati con la pagina nel tuo browser e usati per nome, ad esempio <img src="../logo.png"> o <link rel="stylesheet" href="../style.css">.

Come ottengo un PDF?

Fai clic su «Esporta», scegli PDF e fai clic su «Stampa / Salva come PDF». Nella finestra di stampa scegli «Salva come PDF» come stampante.

Dove vengono salvati i miei documenti?

Solo nel tuo browser. Fai clic sul pulsante a forma di cartella in alto a sinistra (I miei documenti) per aprirli, rinominarli, duplicarli, scaricarli o eliminarli. Cancellando i dati del sito nel browser spariscono, quindi scarica quelli che vuoi conservare - oppure lascia che l'editor li invii al tuo server («Salva sul server»).

Un'IA può scrivere nell'Editor HTML?

Sì, qualsiasi IA - ChatGPT, Claude, Gemini, Copilot o l'IA del tuo strumento di programmazione. Fai clic su «Assistente IA», poi su «Copia il prompt», incollalo nella tua IA e dille cosa deve scrivere. L'IA risponde con un link; fai clic su di esso e la pagina appare nel tuo editor. «Annulla» ritira ogni modifica.

Posso usare l'editor sul mio sito web?

Sì. Integralo con un iframe e scambia documenti con postMessage, oppure lascia che invii ogni versione salvata al tuo server con un webhook. Trovi esempi in Usare l'editor sul tuo sito web.

L'Editor HTML costa qualcosa?

No. L'editor è gratuito, senza pubblicità e senza registrazione.