- Do I need to log in to play?
- No. Submitted solutions will be executed and checked without logging in, but nothing will be saved and you won't appear on the leaderboards.
- Is code.golf free as in speech?
- Yes! It is written in Go, licensed under MIT, and available on GitHub; patches welcome!
- Is code.golf free as in beer?
-
Yes! However hosting isn't, so if you enjoy Code Golf consider donating to its continued existence and improvement via GitHub Sponsors.
Sponsors will receive a couple of additional perks, with more planned:
* Badge hidden if sponsorship is anonymous. Free Sponsor Profile Badge No Yes * Follow Limit 10 24 Solution Notes No Yes - What languages are supported?
-
><>
96b1cfcALGOL 68
Algol 68 Genie 3.12.2ArkScript
4.6.0Assembly
DefAssembler 2.4.5AWK
GNU AWK 5.4.0Bash
5.3.9BASIC
FreeBASIC 1.10.1Berry
bd9c93bbrainfuck
103be5bC
TCC 0.9.27C#
C# 14.0 on .NET 10.0.8C++
Clang 22.1.6Civet
0.11.11Clojure
Babashka 1.12.218COBOL
GnuCOBOL 3.2.0Coconut
3.2.0Common Lisp
GNU CLISP 2.49.92Crystal
1.20.2D
DMD 2.112.0Dart
3.12.1Elixir
1.19.5Erlang
OTP 29.0.1F#
F# 10.0 on .NET 10.0.8Factor
0.101Forth
GNU Forth 0.7.3Fortran
GNU Fortran 15.2.0Gleam
1.16.0Go
1.26.3GolfScript
6155e9fGroovy
5.0.6Haskell
GHC 9.8.2Hexagony
770406aiogii
1.2J
9.6.3Janet
1.41.2Java
OpenJDK 25.0.3JavaScript
V8 14.8.178.28jq
1.8.1Julia
1.12.6K
717063f249Kotlin
2.3.21Lua
5.5.0Nim
2.2.10OCaml
5.4.1Pascal
FPC 3.2.2Perl
5.42.2PHP
8.5.6PowerShell
PowerShell 7.6.2 on .NET 10.0.8Prolog
SWI-Prolog 10.0.2Python
3.14.5R
4.6.0Raku
Raku 6.d on Rakudo 2026.05Rockstar
2.0.31Ruby
4.0.5Rust
1.96.0Scheme
Chez Scheme 10.4.1sed
GNU sed 4.10SQL
SQLite 3.53.1Swift
6.3.1Tcl
9.0.3TeX
3.141592653V
0.5.1VimL
9.2Wren
0.4.0Zig
0.16.0Experimental languages:
05AB1E
c31668bAPL
Dyalog APL 19.0.50027Arturo
0.10.0Befunge
29e4cfaBQN
CBQN 0.11.0CJam
0.6.5CoffeeScript
2.7.0Egel
0.1.14Fennel
1.6.1Harbour
3.0.0Hare
0.26.0Haxe
4.3.7Hush
0.1.4Hy
1.3.0Knight
d118d76Lily
2.4Luau
0.723Odin
2026-05Picat
3.9#7Qore
2.2.0Racket
9.2Rebol
2.7.8.4.10Rexx
Regina 3.9.7Scala
2.13.18Squirrel
3.2Stax
1.2.1Uiua
0.18.1Umka
1.5.6Vala
0.56.19Vyxal
3.11.0If you'd like to see another language added then raise an issue.
- Are warnings ignored?
- Yes. Only STDOUT is checked against the solution, STDERR is however shown back to you to ease debugging.
- Is trailing whitespace ignored?
- Trailing whitespace is trimmed from each line and the entire output, except when solving Quine.
- How are arguments passed to my program?
- Some holes pass arguments, for those your program should read them from the command line arguments (ARGV).
- How do I print Unicode characters?
-
Your source code is sent to the interpreter encoded in UTF-8, and is expected to write output encoded in UTF-8 to STDOUT. For languages where it matters, your code is run in the
en_USlocale with a UTF-8 output encoding.In Unicode-aware languages like Python, this means
print("🙂")andprint(chr(0x1f642))both produce the emoji U+1F642 "Slightly Smiling Face" 🙂, which is encoded asf0 9f 99 82in UTF-8.In less Unicode-aware languages where strings are byte strings, you might still get away with UTF-8 in string literals. For example, OCaml treats
"🙂"as a string of length 4 (four bytes), butChar.chr 0x1f642is an error.In yet other languages, like brainfuck, you have to print the individual bytes
f0 9f 99 82one by one. - How are solutions ranked?
-
There are two scorings in use, bytes and chars. Bytes is the number of bytes of a solution encoded in UTF-8. Chars is the number of Unicode codepoints of a solution. Users may submit up to two solutions per hole per language. This is handled automatically when you enter two solutions and each minimizes a different scoring. Each scoring has its own set of leaderboards. For the chars scoring, both “A” (U+0041 Latin Capital Letter A) and “😉” (U+1F609 Winking Face) cost the same despite the 1:4 ratio in byte count in UTF-8.
Some experimental languages that make heavy use of multi-byte characters (APL, UIUA, 05AB1E, BQN, Vyxal) have a third scoring method that does not yet affect leaderboards or solution saving. This method allows multi-byte characters commonly used in the language to count for only one stroke, while all other characters count as one stroke for every UTF-8 byte in their encoding. Reference PR#2513 for more detail.
- How are solutions scored?
-
There are two leaderboards. There is a global leaderboard and
a language specific leaderboard.
For the language specific leaderboard, the best answer gets 1,000 points and the rest will get points inverseley proportional to their length.
For example, if your solution is double the strokes of the the best solution, it will get 500 points for the language specific leaderboard.
For the global leaderboard, instead of using the best score for a language, we use an Par Value, a value always at least as high as the best score in a language.
Getting exactly par will give you 1,000 points, double the length will get half the points etc.
The par for a hole in a language is calculated as follows:
Par = ((√n + 2) ÷ (√n + 3)) × S + (1 ÷ (√n + 3)) × Sa
n is the number of solutions in this hole in this language. S is the length of the shortest solution in this hole in this language. Sa is the shortest solution among all languages in this hole.The formula for par was chosen such that the shortest solution in any language will always receive a score of at least 750.
Your overall score is the sum of your highest points in each hole.
- Are submissions resource-constrained?
- Yes. Execution time is limited to 5 seconds, CPU & RAM usage is unbounded but this will probably change soon. The length of each solution must be lower than 128 KiB as that's the maximum length of any program argument under Linux.
- Is there an API?
- An API is currently being developed and documented in standard OpenAPI format. A legacy API that just returns scores in JSON exists. The URL is /scores/all-holes/all-langs/all. Note that all-holes and all-langs may be replaced by the names of specific holes and languages.
- Can I see other people's solutions?
- No, that way all holes stay competitive. If you're stuck on how to shave a couple of strokes off your solution then why not visit our Discord server for some advice.