Skip to main content

Overview

Godot can export games to run in web browsers using HTML5 and WebAssembly. Web exports use the Compatibility renderer and can run on most modern browsers.

Requirements

Browser compatibility

Godot web exports require:
  • WebAssembly support
  • WebGL 2.0 (or WebGL 1.0 with GLES2)
  • Modern browser (Chrome 57+, Firefox 52+, Safari 11+, Edge 79+)
The Compatibility renderer is automatically used for web exports. Forward+ and Mobile renderers are not supported in browsers.

Export templates

Ensure web export templates are installed:
  1. Editor > Manage Export Templates
  2. Download templates for your Godot version
  3. Web templates are included in the standard template package

Creating web export preset

  1. Go to Project > Export
  2. Click Add… and select Web
  3. Configure export settings

Basic configuration

Export formats

Standard export

Creates HTML, WASM, and JS files:

Progressive Web App (PWA)

Enable PWA features:
PWA allows users to install your game like a native app and play offline.

Threading support

Enable multi-threading for better performance:
Threads require SharedArrayBuffer, which has strict CORS requirements. Your server must send these headers:

Custom HTML template

Create custom HTML shell:
Set in export preset:

Server configuration

Local testing

Use a local web server to test:
Double-clicking index.html won’t work due to CORS restrictions. Always use a web server.

MIME types

Ensure your server sends correct MIME types:

Compression

Enable gzip or brotli compression:
WASM files are typically large (10-30MB). Compression can reduce size by 60-70%.

JavaScript interface

Communicate between GDScript and JavaScript:

Call JavaScript from GDScript

Call GDScript from JavaScript

Web-specific features

Fullscreen

Download files

Clipboard

Loading screen

Customize loading progress:

Performance optimization

Reduce export size

  • Remove unused assets
  • Compress textures
  • Use audio compression (OGG Vorbis)
  • Enable script minification

Enable compression

Configure server to serve gzip or brotli compressed files.

Optimize for mobile

  • Lower resolution
  • Reduce particle count
  • Simplify shaders
  • Test on mobile browsers

Lazy loading

Split assets into PCK files and load on demand.

Asset streaming

Hosting platforms

itch.io

  1. Export project to web
  2. Create a ZIP of all files
  3. Upload to itch.io
  4. Set “This file will be played in the browser”
  5. Set viewport dimensions

GitHub Pages

Netlify/Vercel

Browser limitations

Known limitations:
  • No multi-threading without proper headers
  • File system access limited to IndexedDB
  • No raw socket support (WebSocket and WebRTC only)
  • Audio autoplay may require user interaction
  • Some browser-specific quirks
  • WASM file size limits on some platforms

Audio autoplay

Debugging web exports

Browser console

Remote debugging

Common issues

  • Check browser console for errors
  • Ensure MIME types are correct
  • Verify files are served over HTTP/HTTPS
  • Check for CORS issues
Configure server to send correct MIME type for .wasm files: application/wasm
Server must send COOP and COEP headers for threading support.
Most browsers require user interaction before audio playback. Add a “Click to start” button.

Web-specific code

Analytics integration

Next steps

Android

Export for Android devices

iOS

Export for iOS devices

Desktop

Export for desktop platforms