Menu
CoddyTech

Online GDScript Compiler

Write, run, and share code snippets - no setup required.

Coddymain.gd
Output
Click Run to see the output here.

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]) or String.format(), round with snappedf(), and try typed variables with := inference.
  • Arrays and dictionaries: typed arrays (Array[int]), map(), filter() and reduce() with lambdas, and dictionaries of item stats you loop over with for key in inventory.
  • Game logic without a game: a match statement for player states, a class with signal health_changed(value) that you wire up with connect() and fire with emit(), and inner classes declared with class Enemy: inside your script.

Online GDScript compiler FAQ

Is the online GDScript compiler free?
Yes. The GDScript playground is free to use, with no sign-up and no Godot download. Godot itself is free and open source under the MIT license.
Do I need the Godot editor installed?
No. Your script runs on a headless Godot 4 engine on Coddy's servers and the output comes back in seconds. You don't need the Godot editor, export templates or a project folder.
How do _ready() and _init() work in the playground?
The file 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?
Yes. Type your input into the input box, one value per line. Each call to 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?
No. The playground runs GDScript as console code: there is no window, no rendering, no physics and no other scenes to load, so nodes like 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?
GDScript uses indentation to mark blocks, and Godot refuses a file that mixes tabs and spaces. The editor indents with tabs, like the Godot editor, so keep tabs throughout; if you paste code indented with spaces, re-indent it the same way.
How do I learn GDScript after trying the playground?
Edit the starter, press Run, and iterate. When you want something structured, Coddy's interactive GDScript course teaches typed variables, match statements, arrays and dictionaries, enums, classes, inheritance and signals, with every exercise running on a real Godot engine and a certificate for each section.

Useful tools for GDScript

Free, browser-based tools that pair well with the GDScript Playground - all part of Coddy.