# "Hello, World!"

So... uh... this is a bit embarrassing. But we don't have a plain "Hello, World!" challenge yet (despite having 35 variants tagged with , and counting). While this is not the most interesting code golf in the common languages, finding the shortest solution in certain esolangs can be a serious challenge. For instance, to my knowledge it is not known whether the shortest possible Brainfuck solution has been found yet.

Furthermore, while all of Wikipedia (the Wikipedia entry has been deleted but there is a copy at archive.org ), esolangs and Rosetta Code have lists of "Hello, World!" programs, none of these are interested in having the shortest for each language (there is also this GitHub repository). If we want to be a significant site in the code golf community, I think we should try and create the ultimate catalogue of shortest "Hello, World!" programs (similar to how our basic quine challenge contains some of the shortest known quines in various languages). So let's do this!

## The Rules

• Each submission must be a full program.
• The program must take no input, and print Hello, World! to STDOUT (this exact byte stream, including capitalization and punctuation) plus an optional trailing newline, and nothing else.
• The program must not write anything to STDERR.
• If anyone wants to abuse this by creating a language where the empty program prints Hello, World!, then congrats, they just paved the way for a very boring answer.

Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language.

• Submissions are scored in bytes, in an appropriate (pre-existing) encoding, usually (but not necessarily) UTF-8. Some languages, like Folders, are a bit tricky to score - if in doubt, please ask on Meta.
• This is not about finding the language with the shortest "Hello, World!" program. This is about finding the shortest "Hello, World!" program in every language. Therefore, I will not mark any answer as "accepted".
• If your language of choice is a trivial variant of another (potentially more popular) language which already has an answer (think BASIC or SQL dialects, Unix shells or trivial Brainfuck-derivatives like Alphuck), consider adding a note to the existing answer that the same or a very similar solution is also the shortest in the other language.

As a side note, please don't downvote boring (but valid) answers in languages where there is not much to golf - these are still useful to this question as it tries to compile a catalogue as complete as possible. However, do primarily upvote answers in languages where the authors actually had to put effort into golfing the code.

For inspiration, check the Hello World Collection.

## The Catalogue

The Stack Snippet at the bottom of this post generates the catalogue from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.

## Language Name, N bytes


where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

## Ruby, <s>104</s> <s>101</s> 96 bytes


If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

## Perl, 43 + 2 (-p flag) = 45 bytes


You can also make the language name a link which will then show up in the snippet:

## [><>](https://esolangs.org/wiki/Fish), 121 bytes


/* Configuration */

var QUESTION_ID = 55422; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 8478; // This should be the user ID of the challenge author.

/* App */

return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

}

jQuery.ajax({
method: "get",
dataType: "jsonp",
crossDomain: true,
success: function (data) {
data.items.forEach(function(a) {
});
comment_page = 1;
}
});
}

jQuery.ajax({
method: "get",
dataType: "jsonp",
crossDomain: true,
success: function (data) {
data.items.forEach(function(c) {
if (c.owner.user_id === OVERRIDE_USER)
});
else process();
}
});
}

var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

function getAuthorName(a) {
return a.owner.display_name;
}

function process() {
var valid = [];

var body = a.body;
if(OVERRIDE_REG.test(c.body))
body = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>';
});

var match = body.match(SCORE_REG);
if (match)
valid.push({
user: getAuthorName(a),
size: +match[2],
language: match[1],
});
else console.log(body);
});

valid.sort(function (a, b) {
var aB = a.size,
bB = b.size;
return aB - bB
});

var languages = {};
var place = 1;
var lastSize = null;
var lastPlace = 1;
valid.forEach(function (a) {
if (a.size != lastSize)
lastPlace = place;
lastSize = a.size;
++place;

.replace("{{NAME}}", a.user)
.replace("{{LANGUAGE}}", a.language)
.replace("{{SIZE}}", a.size)

var lang = a.language;
lang = jQuery('<a>'+lang+'</a>').text();

languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang, user: a.user, size: a.size, link: a.link};
});

var langs = [];
for (var lang in languages)
if (languages.hasOwnProperty(lang))
langs.push(languages[lang]);

langs.sort(function (a, b) {
if (a.lang_raw.toLowerCase() > b.lang_raw.toLowerCase()) return 1;
if (a.lang_raw.toLowerCase() < b.lang_raw.toLowerCase()) return -1;
return 0;
});

for (var i = 0; i < langs.length; ++i)
{
var language = jQuery("#language-template").html();
var lang = langs[i];
language = language.replace("{{LANGUAGE}}", lang.lang)
.replace("{{NAME}}", lang.user)
.replace("{{SIZE}}", lang.size)
language = jQuery(language);
jQuery("#languages").append(language);
}

}
body {
text-align: left !important;
display: block !important;
}

width: 290px;
float: left;
}

#language-list {
width: 500px;
float: left;
}

font-weight: bold;
}

table td {
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="language-list">
<h2>Shortest Solution by Language</h2>
<table class="language-list">
<tr><td>Language</td><td>User</td><td>Score</td></tr>
<tbody id="languages">

</tbody>
</table>
</div>
<tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr>

</tbody>
</table>
</div>
<table style="display: none">
</tbody>
</table>
<table style="display: none">
<tbody id="language-template">
</tbody>
</table>

• @isaacg No it doesn't. I think there would be some interesting languages where it's not obvious whether primality testing is possible. Aug 28, 2015 at 13:56
• If the same program, such as "Hello, World!", is the shortest in many different and unrelated languages, should it be posted separately? Aug 28, 2015 at 15:33
• @mbomb007 Well it's hidden by default because the three code blocks take up a lot of space. I could minify them so that they are a single line each, but I'd rather keep the code maintainable in case bugs come up. Aug 28, 2015 at 19:34
• @ETHproductions "Unlike our usual rules, feel free to use a language (or language version) even if it's newer than this challenge." Publishing the language and an implementation before posting it would definitely be helpful though. Aug 29, 2015 at 23:01
• @MartinEnder ... Almost. If two BF solutions have the same size, the one with smaller lexicographical order will take smaller number of bytes in Unary. Of course the smallest Unary solution translated to BF is guaranteed to be smallest. May 20, 2018 at 10:20

# Coq, 20 30 bytes

Check"Hello, World!".


TRYITONLINE

But you have to first define what string is using this bit of code:

Require Import Coq.Strings.String.
Declare Scope string_scope.
Delimit Scope string_scope with string.
Bind Scope string_scope with string.
Local Open Scope string_scope.
Register string as core.string.type.
Register EmptyString as core.string.empty.
Register String as core.string.string.


And i think this is probably the shortest answer.

# Exceptionally, 17 bytes

P"Hello, World!"/


Attempt This Online!

### Explanation

P "Hello, World!"  ' Print that string
/                  ' Divide the register (initially 0) by itself to exit the program


# SPDT, 756 bytes

p 0
r 0 0 1 2
r 1 0 2 3
r 4 0 2 3
r 3 0 2 5
r 5 0 2 6
r 6 0 2 7
r 7 0 2 8
r 8 0 2 9
r 9 0 2 10
r 10 0 2 11
r 11 0 2 12
r 12 0 2 13
r 13 0 2 14
r 14 0 2 15
r 15 0 2 4
r 5 0 2 16
r 8 0 2 16
r 11 0 2 16
r 12 0 2 16
r 4 0 2 16
r 8 0 2 17
r 11 0 2 17
r 12 0 2 17
r 13 0 2 17
r 5 0 2 18
r 6 0 2 18
r 7 0 2 18
r 8 0 2 18
r 9 0 2 18
r 11 0 2 18
r 12 0 2 18
r 14 0 2 18
r 15 0 2 18
r 3 0 2 19
r 6 0 2 19
r 7 0 2 19
r 8 0 2 19
r 9 0 2 19
r 12 0 2 19
r 14 0 2 19
r 11 0 2 20
r 13 0 2 20
r 5 0 2 21
r 6 0 2 21
r 7 0 2 21
r 8 0 2 21
r 9 0 2 21
r 10 0 2 21
r 12 0 2 21
r 13 0 2 21
r 14 0 2 21
r 15 0 2 21
r 4 0 2 21
r 3 0 2 22
r 5 0 2 22
r 6 0 2 22
r 7 0 2 22
r 8 0 2 22
r 11 0 2 22
r 12 0 2 22
r 13 0 2 22
r 14 0 2 22
r 15 0 2 22
l 23
l 22
l 21
l 20
l 19
l 18
l 17
l 16


SPDT is an esolang I've been wanting to make for a while now. Aside from I/O, it consists entirely of Single Pole Double Throw, or Form C, relays. This answer, which is possibly imperfectly golfed since I used a custom transpiler with macros to generate it, consists of relays forming a loop counting from 1 to 13, then back 1, infinitely. For each of these states, it uses relays to only light up the bits which are on in that character of Hello, World!, producing the following output:

# ABC, 21 bytes

WRITE "Hello, World!"


Try it online!

# A Language Programmed While Listening to Godspeed You! Black Emperor, 93 bytes

charms 72. 101. 108. 108. 111. 44. 32. 119. 111. 114. 108. 100. 33. 10﹔
print﹔
give up﹔


This is an esolang, and the goal of the language was to make it as annoying as possible to program.

# CATHY, 175 bytes

catHYcAthycAthYcAthYcaTHycathycAthYcAthYcAthycatHycaTHycaThYcaTHycathYcatHycatHYcaTHycaTHYcAthycathYcatHycatHYcatHycatHYcatHYcatHYcatHYCatHycathYcathYcaThYCAthyCATHycATHycAtHy


Try it Online! -90 thanks to Steffan.

CATHY is a joke language based on a certain spam post. In normal form:

389960998265612367812323333;115τCƒ+


It pushes a huge integer, then converts to base 115 and charcodifies.

• 170 bytes Jun 26 at 22:06

# Algoid, 28 bytes

text.output("Hello, World!")


Now that's just boring in such a fun language... Here's a slightly longer version, let's get some colours going for 104 bytes:

algo.hide()
algo.setColor(algo.color.GREEN)
algo.setBgColor(algo.color.DARK_RED)
algo.text("Hello, World!")


See the output here

Okay I've finished for the day now :)

# Io, 21 bytes

"Hello, World!" write

• This Io (TIO) seems to have print, but not write. Is this another language with the same name? Feb 11, 2018 at 15:40
• @Dennis It appears to have write, but it appears to write to some mysterious location/file/somewhere else instead of STDOUT Apr 13, 2018 at 8:35

# Common LISP, 22 bytes

(princ"Hello, World!")


# Burlesque, 17 bytes

,"Hello, World!"Q


The leading , tells Burlesque to ignore standard input. "Hello, World!" pushes a string to the stack, and Q formats it for display without quotes.

• Yes, otherwise Burlesque will add "".
– Lynn
Oct 23, 2015 at 21:25
• Sure, that works just as well! The , primitive (it's sort of like a flag, I guess?) is there for historic reasons; Q is a new-ish synonym for sh which was longer.
– Lynn
Oct 23, 2015 at 21:46

# RPython, 60 bytes

def e():print'Hello, World!';return 0
target=lambda*_:e,None


# awk, 25 bytes

END{print"Hello, World!"}

• I know little of awk, but I think you can remove the END part. (It's June I know). Jun 2, 2016 at 19:30
• Actually, if you use END, it requires some kind of input... the input can be empty but it seems to be needed on my version of AWK. You do need a label, though, otherwise nothing will happen. BEGIN works, but it adds 2 bytes. :( Jul 19, 2016 at 13:11
• You're both right(ish). If you can invoke the one blank line of input rule you don't need the END, otherwise you must use BEGIN not END. Mar 19, 2017 at 8:53
• If the one-blank-input rule is allowed, this works too $0="Hello World!" Apr 14, 2021 at 10:06 # Erlang, 63 bytes Save as h.erl, then compile with erl -s h m, I think. -module h. -export[m/0]. m()->io:fwrite("Hello, World!").  ## Glypho, 480 bytes In the "shorthand" format, it's 120 bytes: 1d+d1+d*+ddd++ddd++1+d11+d*d++d11+1+d++d1-dd+++d1<d>+-d++11+d*d*d+<d>d+d+d<d>+d+1+d1-dd+++d1-<d>+d*1+11+1+d+d*d+<d-+>[o]  An example conversion to "true" Glypho (using the translation of the Java interpreter, which differs slightly from that documented in the esolangs.org page) is: v># # :: < < <v# #*>*> ##:#**#,<,<: : > > * *v>>v # ##,#, + +:++: ++ ## *<<*,^,^<<#v<<v#v::v< < <,, +,+,+>>+*,,*+*+*,,*>**^v# #,,:^#vv#>+>+ << > >, , ++*>: :v<v<^#^#v::v>::>v**v # #::>^>+>>:>:>>>*>>##>*^ *# # vv ,::,<<>:++ *vv*v:v:^vv< > > ,,>>:>: << >+>>^ ^ ^^*^+,+,#::#*:*:: :v v , # #<<#<#**#^,^,+##+** +**+,:,:::>*<^v< v v+^+^*^^*+<<++##+v#v#++<>:< :* **+ + ^ * *<+<+< *vv+<:^^::: ^+*<<***<^+ ++:+:^##^:>:>+::< > >#>># * >,>, :^ ^>>^##<#,<,*^ *<:<  (using Windows line terminators \r\n) where I tried to disguise it as a 2D language for the Programming Language Quiz. The basic approach is to push onto the stack a 0 followed by the codepoints in reverse order, and then print them with the loop [o]. In order to golf the pushing, I first push 11 and then I can push a new 11 whenever I want with <d>; the final <d-+> replaces that 11 on the bottom of the stack with the desired 0. I experimented with various values on the bottom of the stack, and 11 is the only one for which my brute-force searcher was able to find expressions for each of the characters which were no more than 11 bytes each. (12 bytes was taking too long). • Quick translation from my CSL answer (i.e. super suboptimal), 456 Apr 13, 2018 at 6:32 # 23, 52 bytes 17,13,72,101,108,108,111,44,32,87,111,114,108,100,33  This uses 23.dezsy notation: 17,13 prints the 13 integers that follow as characters. Try it online here. (Don't forget to replace the example with the above source code.) # Maxima, 23 bytes print("Hello, World!")$


# UNBABTIZED

:72.:101.:108.:108.:111.:44.:32.:87.:111.:114.:108.:100.:33


:x prints x as a character and . acts as a statement separator.

The official interpreter is written for Python 2.2. You can use it in modern versions of Python by prepending the line

# coding: latin1


# az, 16 bytes

"Hello, World!".


# Cardinal, 15 bytes

%"Hello, World!


# LMNtal, 35 bytes

io.use.io.print("Hello, World!",_).


A weird programming language from Japan that seems to be inspired by Prolog.

# Fishing, 37 bytes

v+CCCCCCCCCCCCCCCC
Hello, World!N


I don't think there's anything to golf beyond the example listed on the esolangs page, so I didn't really write this myself. Hence, community wiki.

# HPPPL, 44 43 bytes

HP Prime Programming Language for the HP Prime color graphing calculator.

export h()begin print("Hello, World!");end;


(golfed down by one byte, thanks to kirbyfan64sos!)

Output:

This is a full program that you call by entering h to start it.

If you just want to have the output to the terminal, then a shorter (22 bytes) version in Home Mode works, too:

print("Hello, World!")


A free emulator is available here: http://www.hp-prime.de/en/category/13-emulator

• Is the space between the right parenthesis and begin needed? Sep 1, 2015 at 13:55
• @kirbyfan64sos Thanks for the hint. No, it’s not necessary.
– M L
Sep 1, 2015 at 14:30

# RUBE, 47 bytes

A cellular automaton-based language about warehouses, crates, dozers, and conveyor belts:

2
1
766
2c4
256
07f
662
cfc
466
85c
OOO
ccc
===


It turns out stacking all the crates on top of each other like 2\n1\n6\n... is also 57 bytes, and is "simpler", but I didn't want to stretch the page. :)

Update: stacking the crates into a rectangle is shorter! Who'd've thought?

# Doorspace, 92 bytes

The language is also known as Qugord.

~group h from %2 to %14 affect h into "Hello, World!" each h into 0 task give 0 to 1 publish


or

~group h from 0 to %12 affect h into "Hello, World!" each h into 0 task give 0 to %0 publish


It's seriously bugging me that this has a horizontal scrollbar because of a single character. I don't see how to shorten it any further though.

This solution is mostly a golfed version of the "Hello, World!" example on the esolangs page. The important concepts of the language are that it operates on an infinite main array, initialised to zeroes; and then there's also an output array, which is reset every time you print its contents. If you know what the commands mean, the code is actually quite readable if split across several lines (which is not valid in the language):

group h from %2 to %14
affect h into "Hello, World!"
give 0 to 1
publish


The first line defines a "group tag" h, which is some subarray of the main array. In this case, it addresses the cells at indices 2 to 14 (leaving 2 cells for future use).

The second line writes the character codes of Hello, World! into these 13 cells.

The third line defines a foreach loop over the cells in h, which works by copying the current value into the specified cell (0) and then executing the code after it.

The fourth line is executed once for each character code (which we find in cell 0). It moves the character code from the 0th cell of the main array to the 0th cell of the output array (which we index relatively by looking at index 1 on the main tape, which is zero).

The fifth line prints everything in the output array up to the last non-zero element (i.e. just the first cell in our case).

# Parenthetic, 1036 Bytes

This can undoubtedly be done better, but it's about the best I can come up with at the moment.

((()()())(()()()())((()()(()))((())()()()())((())()()()()()()()())))((()()())(()(())())((()(()))(()()()())((())()()()())))((()()())(()()(()()))((()()(()))(()()()())((())()()())))((()()())(()(()())())((()()(()))(()(())())((())()()())))((()(())()(()))((()((()))())((()(())(())())((()()(()))(()(())())((())()())))((()((()))())((()(())(())())((()(()))(()()(()()))((())()()()()())))((()((()))())((()(())(())())(()(()())()))((()((()))())((()(())(())())(()(()())()))((()((()))())((()(())(())())((()(()))(()(()())())((())()()())))((()((()))())((()(())(())())((()(()))(()()()())((())()()()()()()()()()()()())))((()((()))())((()(())(())())(()()()()))((()((()))())((()(())(())())((()(()()))(()()(()()))((())()()()()()()()()())))((()((()))())((()(())(())())((()(()))(()(()())())((())()()())))((()((()))())((()(())(())())((()(()))(()(()())())((())()()()()()())))((()((()))())((()(())(())())(()(()())()))((()((()))())((()(())(())())((()(()))(()()(()()))((())()()()())))((()((()))())((()(())(())())((()(()))(()()()())((())())))(()((())))))))))))))))))


General Steps

Define A 32
Define B 36
Define C 32 * 3
Define D 36 * 3
Build a list of chars with (A*2)(C+5)(D)(D)(D+3)(A+12)(A)(C-9)(D+3)(D+6)(D)(C+4)(A+1)
Output list + empty set as string

# l33t, 104 bytes

7 99999998 1 7 9991 1 7 6 1 1 7 2 1 5 0 7 99997 1 8 92 1 6 0 8 995 1 7 995 1 7 2 1 8 5 1 8 7 1 5 0 7 0 1


I've been using the Ruby interpreter which seems to insert an 10 (END) at the end of the code implicitly.

l33t is supposed to look like l33t-5p34k. However, it is interpreted by simply summing the digits in each "word" and turning that into an opcode. So for golfing all we want is those digits. Golfing l33t like this is definitely living on the edge though. Quoting from the language spec:

It is possible to program in l33t just using numbers, i.e. not forming letters in l33t 5p34k. However, programmers who do this are teh sUxX0r, and the interpreter is well within its rights to format your hard drive for attempting this.

As for the language itself, it's basically a Brainfuck-derivative. The main differences are that the source code is living on the tape as well (with an independent memory and instruction pointer), and that you define an offset whenever you move forward, backward, increment or decrement (so you can make larger jumps and increment more efficiently). Therefore, the techniques used in the short Brainfuck solutions don't help much here.

I started out with the naive solution (increment/decrement to value, print, repeat). That was 105 bytes. I managed to shave off one byte by computing the symbols , ! on a different memory cell than the letters (because the offsets from o to ,, space to W and d to ! are expensive. I think I might be able to save a few more by jumping into the program memory, but I'll have to try that tomorrow.

# Wake, 16 bytes

:"Hello, World!"


Not much room for golfing.

# ShortScript, 2 bytes

By using the function from the standard library:

\$H


And by not using it:

→Hello, World!

• That library seems to be missing from your reference implementation on Esolang. Sep 4, 2015 at 14:17
• Yes, I the current version is a bit buggy Sep 4, 2015 at 16:58
• I have updated the esolangs page. Now it will work. Sep 4, 2015 at 17:48
• That implementation doesn't seem to print the exclamation point. Sep 4, 2015 at 17:58
• I will fix it tomorrow, when I am at PC. Sep 5, 2015 at 21:02

# Scheme, 2426 25 bytes

(write "Hello, World!")

(display"Hello, World!")


simple but no one has done it in this language yet.

edit: fixed the quotes being printed.

• i changed the code a little so it doesn't show the quotes
– Buzz
Aug 31, 2015 at 14:20
• Are the quote marks necessary in case of display? The H in Hello needs to be upper-case btw. Sep 3, 2015 at 0:16
• @CoDEmanX Yeah the quotes are necessary. Otherwise it thinks its a variable.
– Buzz
Sep 3, 2015 at 13:30
• Sure you can't get rid of the space before "?
– Lynn
Sep 4, 2015 at 14:08
• That space can be removed. Normally scheme needs the spaces to tell two things apart. but in this case it doesn't need it
– Buzz
Sep 4, 2015 at 14:28

# Sieve, 69 bytes

+|72|.+|101|.+|108|..>+|111|.>+|44|.-|32|.+|87|.<.+++.<.-|100|.-|33|.


Sieve is a BF-like programming language. It adds a special command |X|, called a sieve, that executes the command before it until the selected tape unit is equal to the number within the sieve. +|72|. outputs the character 72, which is an "H".

Here's an alternative with the same byte count:

+|72|.+|101|.+|108|..>+|111|.>+|44|.-|32|.>+|87|.<<.+++.<.-|100|.>>+.


The only change is that it saves 32 (space) and uses it later to print 33 (!).

• Can you save some bytes by leaving the cell of the space untouched for World and then going back to it to print ! with a simple +.? Sep 5, 2015 at 21:24
• @MartinBüttner Yes, oops. Sep 5, 2015 at 21:26
• @MartinBüttner Actually, the byte count is the same. Sep 5, 2015 at 21:29
• +|72|.+|101|.>+|108|..>+|111|.>+|44|.-|32|.+|87|.<.+++.<.<-.-|33|. for 66 Sep 6, 2015 at 5:33
• @Sp3000 Welp, already getting my butt kicked at my own language. Sep 6, 2015 at 20:07