Online GDScript Compiler
Write, run, and share code snippets - no setup required.
Run GDScript online in your browser
A free online GDScript playground and code runner. Write a Godot script in your browser, press Run, and a headless Godot 4 engine executes it in seconds. No Godot editor to download, no project to create, nothing to install.
Your file, main.gd, runs as a one-node scene: the script is added to the scene tree, so _init() and _ready() run just as they would in a game, and the program ends after the first frame. Everything prints to the console, which makes it a quick place to practice the language itself: static types, arrays and dictionaries, match, classes, inner classes and signals. The editor is built on the same engine as VS Code and indents with tabs.
What makes this GDScript playground useful
- Real Godot execution: your script runs on a headless Godot 4 engine, not an emulator, so built-in types,
print(), string formatting and the standard GDScript functions behave exactly as they do in the Godot editor. - Stdin input is supported. Each call to
OS.read_string_from_stdin()reads one line from the playground's input box, with the newline already stripped, so a script can ask for a name and a number like the starter does. - Clear errors: a runtime error shows up in the output with its message, and a file that mixes tabs and spaces is refused before it runs, just like in Godot. The editor indents with tabs, so your indentation stays consistent.
- Free and open source all the way down: Godot is MIT licensed, and the playground needs no account, no download and no Godot project.
What you can build in the GDScript playground
- String formatting and math: build output with
%placeholders ('%s has %d HP' % [name, hp]) orString.format(), round withsnappedf(), and try typed variables with:=inference. - Arrays and dictionaries: typed arrays (
Array[int]),map(),filter()andreduce()with lambdas, and dictionaries of item stats you loop over withfor key in inventory. - Game logic without a game: a
matchstatement for player states, a class withsignal health_changed(value)that you wire up withconnect()and fire withemit(), and inner classes declared withclass Enemy:inside your script.
Online GDScript compiler FAQ
Is the online GDScript compiler free?
Do I need the Godot editor installed?
How do _ready() and _init() work in the playground?
main.gd is attached to a single node that is added to the scene tree, so _init() runs first, then _ready(), and the program ends after the first frame. A script without extends runs its _init(). There is no game loop that keeps running, so put the code you want to run in _ready() or _init().Does the GDScript playground support stdin input?
OS.read_string_from_stdin() returns the next line without its newline, and you can convert it with int() or float(), as the starter script does.Can I use scenes, sprites or physics?
Sprite2D don't show anything and there is no _process() loop. Everything you pass to print() appears in the output, which covers the language itself: types, collections, match, classes and signals.Why does my script fail with an indentation error?
How do I learn GDScript after trying the playground?
Useful tools for GDScript
Free, browser-based tools that pair well with the GDScript Playground - all part of Coddy.