Paste / preview / download

Download Your HTML, CSS and JavaScript Project

Have HTML, CSS and JavaScript in three separate pieces? Paste them here, check the combined preview and download a ready-to-host ZIP: index.html, styles.css and script.js in one folder, with the stylesheet and script already linked.

Files linked for youPreview before you downloadReady for any static host
Try it here

Build your project ZIP

Paste each part into its box. The preview combines them as you type, and the list under it shows exactly what the ZIP will contain.

Options

The ZIP is built in your browser with the open-source JSZip library; nothing is uploaded. Images and other assets are not included: add them to the folder after unzipping, using the same relative paths your HTML refers to.

HCODX / project preview
Files in the ZIP
    Separate files

    Why a page should live in three files

    Playgrounds and tutorials often give you HTML, CSS and JavaScript as three blocks. A real site keeps them as three files.

    When code comes from an online playground, a course or a chat answer, it usually arrives as three blocks with no indication of how they connect. Pasting the CSS into a style element and the script into the HTML works for one page, but a second page then needs its own copy of everything. Separate files avoid that duplication: every page links the same styles.css, and a change there updates the whole site.

    This tool assembles the three pieces into a folder that works the moment you unzip it. If index.html does not already link styles.css and script.js, it adds the link and script tags to the head, and if you only paste body content, it wraps it in a complete document with a doctype, charset and viewport. CSS or JavaScript boxes left empty are not included, and no link is added for them.

    The preview shows all three pieces running together before you download, so you can catch a missing piece or a broken selector early. The list beneath the preview names every file and its size, exactly as it will appear in the ZIP.

    Linked for you

    The stylesheet and script tags are added to index.html when they are missing.

    Previewed first

    All three files run together in a sandboxed preview as you type.

    Ready to host

    One folder with index.html at the top, the way static hosts expect it.

    The result

    What the tool adds to index.html

    Two lines in the head connect the files. This is the actual output for a page that had neither.

    The link element loads the stylesheet before the page is displayed, so it appears styled from the start. The script is loaded with defer, which downloads it in parallel but runs it only after the HTML has been read, so the script can find every element on the page without being moved to the end of the body.

    If your HTML already contains these tags, nothing is added twice. Turn off Link styles.css and script.js in index.html if you want the file left exactly as you pasted it.

    index.html after linking
    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <title>Counter</title>
      <link rel="stylesheet" href="styles.css">
      <script src="script.js" defer></script>
    </head>
    <body>
      <h1>Counter</h1>
    </body>
    </html>
    Next steps

    From ZIP to a live website

    The folder is ready for a static host as it is.

    01

    Download and unzip

    Select Download ZIP, then extract it: double-click on a Mac, or right-click and choose Extract All on Windows.

    02

    Open and check

    Open index.html from the folder in your browser to confirm the styles and script work outside the editor.

    03

    Add your images

    Copy images into the folder, or an images folder inside it, matching the paths in your HTML.

    04

    Publish

    Upload the folder to GitHub Pages, Netlify or Cloudflare Pages. The export and deploy guide walks through each one.

    Keep the folder as your master copy. To change the site later, edit these files and upload them again.

    Other exports

    Which HCODX export to use

    Three tools can give you a ZIP. They suit different starting points.

    Three pieces

    This page

    Paste HTML, CSS and JavaScript and get them as linked, separate files in one folder.

    A whole project

    HCODX editor

    Export downloads every file and folder in the project tree, including images.

    A quick snippet

    HTML Runner

    Export ZIP gives one index.html that loads your code, plus your original files in a sources folder.

    Questions

    Project download questions

    One folder named after your project, containing index.html, plus styles.css and script.js when those boxes have content. The list under the preview shows the exact files and sizes.

    Yes, after unzipping. Put them in the folder, or in a subfolder such as images, so the paths in your HTML match where the files are.

    A deferred script runs after the HTML has been parsed, so it can find every element, yet it still downloads early. That is why it can sit in the head.

    Usually. CodePen's HTML pane holds only the body content, which this tool wraps in a full page. Code written in Sass or another preprocessor must be compiled to plain CSS first, and libraries added in CodePen's settings need their own script or link tags.

    On Windows, right-click it and choose Extract All. On a Mac, double-click it. On a phone, the Files app on iPhone and most Android file managers can extract ZIP files.

    No. The ZIP is created in your browser and saved straight to your downloads. HCODX never receives your code.

    Want to keep building?

    Import the folder into the HCODX editor with Open Folder to add pages and images, then export the whole project again.

    Instant HTML Runner & Viewer with Live Preview

    Need to run a short HTML, CSS and JavaScript snippet? The HTML Runner Online has a focused editing surface with live output.

    Open HTML Runner Online