# “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. – Martin Ender Aug 28 '15 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? – aditsu quit because SE is EVIL Aug 28 '15 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. – Martin Ender Aug 28 '15 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. – Martin Ender Aug 29 '15 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. – user202729 May 20 '18 at 10:20

# MY, 1 byte.

Here is the hex:

FF


I'm finally ready to reveal my language. It's still a major WIP, and the undefined byte meaning is temporary (except for maybe 0xFF). I will eventually update this to include a non-hacky solution when MY is able to do that.

# Klein, 16 + 3 = 19 bytes

"Hello, World!"@

• +3 for -A flag
• Also contains a null argument for the topology, I'm not even sure how to score that.

Try it online!

Competing for the bounty.

• Not competing for the bounty, Wheat Wizard stated in chat that he wouldn't award it to those using " (otherwise this would be a trivial bounty). – Okx May 19 '17 at 6:18

## StupidScript, 214 bytes

It's a joke language that I just made. Mark Watney would be proud.

80.5 0.0
80.5 23.0
69.0 103.5
69.0 161.0
80.5 46.0
23.0 0.0
23.0 23.0
46.0 92.0
69.0 57.5
69.0 138.0
69.0 138.0
69.0 172.5
23.0 138.0
23.0 0.0
57.5 80.5
69.0 172.5
80.5 23.0
69.0 138.0
69.0 46.0
23.0 11.5
23.0 23.0


# Fishing, 25 24 bytes

[+_
|C]Hello, World!Ni


It exits with an error.

# Fishing, 34 bytes

v+CCCCCCCC^]
Hello,
N!dlroW


Without errors.

# Shtriped, 239 bytes

e n
e b
i b
+ x y
+
i x
d y
+
+
d x
0
+ b b b
1
+ b n n
0
z x
d x
z x
D
1
s n
z n n
z b b
i b
Y
0
0
Z
1
Y
Y
B
0
1
1
Z
1
Y
1
Y
D
B
B
1
0
Z
Y
D
B
1
Y
B
0
Z
D
1
B
B
Y
1
0
D
Y
1
1
Y
B
Z
D
B
Y
1
0
Z
Y
D
B
1
1
1
1
B
0
D


Try it online!

This Hello, World! in Shtriped terminates somewhat quickly, since it doesn't encode the entire string in one number.

# Lean Mean Bean Machine, 55 bytes

OOOOOOOOOOOOO
"""""""""""""
Hello, World!
!!!!!!!!!!!!!


I think this is the shortest.

Here's a somewhat more entertaining alternative approach in 96 bytes:

OOOOOOOOOO
"""
Hel
!!!""""
!o, W
!!!!

!   "
r
!""
!     d!
!!


This one only sets 1 marble to each letter, and re-uses the l and o marbles, much less golfy, but more true to the spirit of the language.

# Set, 123 bytes

set ! H
set ! 101
set ! 108
set ! 108
set ! 111
set ! 44
set ! 32
set ! 87
set ! 111
set ! 114
set ! 108
set ! 100
set ! 33


Needed to use raw ASCII codes because lowercase letters are reserved for variable names.

Try it online!

• Wow, someone actually used this language. I'm both surprised and very happy – Matheus Avellar Aug 10 '17 at 1:58
• @MatheusAvellar If you haven't yet noticed it has been used in the largest polyglot in existence. – MD XF Aug 10 '17 at 3:55
• I had no idea! That's the coolest! Hahaha – Matheus Avellar Aug 10 '17 at 9:05
• You can use W instead of 87 – ASCII-only Apr 11 '18 at 9:13
• @ASCII-only but the bytecount is 123 – MD XF Jun 18 '18 at 21:22

# MY, 60 bytes

27á'←1Aá'←8Aá'2×←1Bá'←44á'←2Ġ'←78á'←1Bá'←4Bá'←8Aá'←AȦ'←33á'←


MY IS ON TIO!!

## How?

Outputs H, e, ll, o, <space>, W, o, r, l, d, ! to the console.

I created a 3rd answer to this question due to the differing techniques used, this uses concatenation on numbers (27á pushes 72), one uses increment and decrement, while another uses a builtin.

# Braingolf, 17 bytes

Got bored, made my own language, here's Hello World

"Hello, World!"&@


Explanation:

"Hello, World!"    Push the 13 chars of Hello World to the stack as charcode integers
&@  Pop the entire stack and print as chars


Alternatively, here's hello world from before I added multi-char strings and printing:

#!#d#l#r#o#W# #,#o#l#l#e#H@@@@@@@@@@@@@


Explanation:

#!                                 Push the charcode of char '!' to the end of the stack
....................             Do this for every character in "Hello, World!" in reverse order
@@@@@@@@@@@@@  Pop and print the last element of the stack 13 times

• 1. outdated, 2. doesn't even print the right Hello, World! – ASCII-only Aug 23 '17 at 6:27
• @ASCII-only fixed – Skidsdev Aug 23 '17 at 8:20

# Emoji, 23 24 bytes

💬Hello, World!💬➡


Should be pretty clear. Just pushes Hello, World! and than outputs.

# Apps Script + Google Sheets, 39 bytes

### Script

function Q(){return"Hello, World!"}


### Sheet

=q()


## Original, 40 bytes

### Script

function Q(){return "Hello, World!"}


### Sheet

=q()

• Can't you do return"Hello, World!"? – Erik the Outgolfer Jun 29 '16 at 21:41

.-$"Hello, World!"  Try it online! # LLVM IR, 110 bytes @s=global[13x i8]c"Hello, World!"declare i8@puts([13x i8]*)define i8@main(){call i8@puts([13x i8]*@s)ret i8 0}  Try it online! # DOBELA, 214 bytes ,,.,,,,.,..,,.,,,..,..,,,...,,.,,..,....,.,.,...,,.,,,,,,,.,..,,,..,....,..,..,,,..,..,,,..,,.,.,.,,.,,,$^
.                                                                                                         #


!        d        l        r        o        W                 ,        o        l        l        e        H
,,.,,,,. ,..,,.,, ,..,..,, ,...,,., ,..,.... ,.,.,... ,,.,,,,, ,,.,..,, ,..,.... ,..,..,, ,..,..,, ,..,,.,. ,.,,.,,,\$^
.                                                                                                                     #

H = ascii 0x48 = 01001000 = ,.,,.,,,


Put bits in FIFO then print them by hitting ^ from below.

Try it online

• 123 – ASCII-only Apr 12 '18 at 4:20

# Triangularity, 71 49 bytes

.... ....
..."!"...
.."ld"+..
." Wor"+.
"Hello,"+


Try it online!

Saved 22 bytes thanks to an ingenious method by Mr. Xcoder!

## Old version

...........
...."H"....
..."ell"...
.."o, Wo"..
."rld!"W"".
.....J.....


Try it online!

# Stax, 8 bytes

èï┬▀↨╩4G


Run and debug online!

## Explanation

èï┬▀↨╩4G is the packed form of the ASCII Stax code jaH1"jS3!, which is in turn a compressed string literal of Hello, World! with the ending backtick omitted.

# Min, 20 bytes

"Hello, World!" puts


# ALPHA, 36 bytes

ALPHA is a palindomic alphabetical esoteric programming language made by me and caird. Thought it would be fun to write an answer here.

ALPHA is made of mirrored alphabetical "Containers" that perform programming commands.

KMDHello World!DMK


Explanation:

K - Start line container
M - Start print container
D - Start string container
Hello World!
D - End string container
M - End print container
K - End line container


This lang is WIP. If you want to fix bugs, fork the interpreter, or contribute to completing the interpreter, Go to ALPHA's repository.

## PHP (on a standard Apache Server, result needing to target STDOUT), 30 27 Bytes

<?php die("Hello, World!");


Note: this is not to detract form earlier PHP example relied on an option assuming PHP wasn't being used as a webserver and abusing the HTML-effect outside of ?php tags to have an answer that was just "Hello, World!"

That said, that solution made some non-standard server assumptions which aren't common with PHP. So I'm presenting an alternative that assumes a normal server layout, but still needs to go to STDOUT. This is not to detract from the previous posters example, but to present one in a different setting with different constraints.

Note: originally thought using

<?php fwrite(STDOUT,"Hello, World!"); ?>


would be the only way, but then realized the die (normally used killing the script with an error) outputted to STDOUT and didn't use extra variables.

Updated: Cut off a few bytes recalling that "die" wont' bother with anything after itself, so didn't need the closing ?>.

Note: Worth noting, that if shorttags were on with a PHP5 server, could drop down 3 more bytes to 24 bytes with

<? die("Hello World!");


However, I was specifically going a standard server, and shortags are now off by default making a server with them on no longer standard.

Example (courtesy of Scrooble): Try It Online!

• Welcome to the site, and nice answer and explanation! It is common practice here to include a Try it online! link in answers so others can run and inspect your code with ease. – Khuldraeseth na'Barya Mar 13 '18 at 0:32

## Euphoria, 23 bytes

puts(1,"Hello, World!")


The (1, parameter tells the puts function to send the output to STDOUT, and there is no carriage return or EOL character for this one line program. This program will work as-is on both RDS Euphoria (v3.1.1 - last commercial version) and OpenEuphoria (v4.1 - current opensource version). The code omits the "optional trailing newline" (per the challenge rules) or else it would be two characters longer (adding \n after the !).

I am surprised that no one had added Euphoria to this challenge before now but I am glad that I could as I really like this powerful little language. Since no one added it to this list after more than 2 years I am thinking that maybe CodeGolfers never heard of Euphoria? I am not sure if it is okay to do this here but what follows is a very short description of the language for context. If this is not okay I apologize in advance. Also, where would such information be appropriate? Is there a "directory" of languages post somewhere in the site?

Euphoria was released in 1995 (back in the days of DOS and Windows 3.1) with only two data types: the atom (each contains a single number) and the sequence (essentially a dynamically-sized array of zero or more atoms). Two other types (the integer and the object) were added in recent years to help with efficiency of execution. One of the most interesting things that attracted me to this language long ago besides its remarkably uncomplicated structure is that it runs incredibly fast for an interpreted language. Also it has engines that run on Windows, Linux, and Mac OSX so user code is cross-platform.

PS: It seems as of the time of this posting that the original RDS website linked above is down due to hosting problems after 20 years with the same host. It is unclear when (or if) it will come back up. However the rather extensive library of user created programs for the language is archived here if anyone is wanting good sample code to explore the language.

# LNUSP, 360 353 bytes

-6 bytes thanks to ASCII-only

001 . !.!
002 !    !
001 *  !!
033 +
001 *
100 +
001 *
108 +
001 *
114 +
001 *
111 +
001 *
087 +
001 *
032 +
001 *
044 +
001 *
111 +
001 *
108 +
001 *
108 +
001 *
101 +
001 *
057 +
015 +                    ?...?@             !
001 *                   ?@ .  ?
001 !                   . +.  *
001  .                  ?  !  ?
001   !..................?.@.?


Ungolfed version:

001 . !.!                  .OUTPUT          .EXIT
001  .   !                 .                .
001 ! .  !                 .                .
001 .  !!                  .                .
001 *                      .                .
033 + !                    .                .
001 *                      .                .
100 + d                    .                .
001 *                      .                .
108 + l                    .                .
001 *                      .                .
114 + r                    .                .
001 *                      .                .
111 + o                    .                .
001 *                      .                .
087 + W                    .                .
001 *                      .                .
032 +                      .                .
001 *                      .                .
044 + ,                    .                .
001 *                      .                .
111 + o                    .                .
001 *                      .                .
108 + l                    .                .
001 *                      .                .
108 + l                    .                .
001 *                      .                .
101 + e                    .                .
001 *                      .                .
072 + H                    .                .
001 *                      .                !
001 .                      .               .
001 .                      .              .
001 .                      .             .
001 .                      .            .
001 !                      .           .
001  .                     .          .
001   .                    .         .
001    .                   .        .
001     .                @ .       .
001      .                +.      .
001       .                !     .
001        .               .    .
001         .           ?.....?@
001          .         ?   .   ?
001           .        .   .   *
001            .       ?   .   ?
001             !.......?..@..?


Note that TIO LNUSP does not require newline at the end of file.
Some explanations are here. Can be golfed 4 bytes more, I didn't do it for aesthetic purpose.

Try it online

• You can move the topmost * one line up – ASCII-only Apr 14 '18 at 2:26
• Also, what is the 4-byte golf? I'm assuming it's removing one character from the right side of the print loop? – ASCII-only Apr 14 '18 at 2:42
• re: topmost *: never mind. it appears you can remove it completely – ASCII-only Apr 14 '18 at 2:49
• @ASCII-only yes (about 4-byte golf) – stasoid Apr 14 '18 at 4:28

# Zig, 81 bytes

pub fn main()!void{try(try@import("std").io.getStdOut()).write("Hello, World!");}


Try it online!

• This looks like an interesting language. The author appears to be aware of TIO! – Esolanging Fruit May 9 '18 at 4:09

"!dlroW ,olleH"W@


A (very-unfinished at the time of this writing) fungelike. This works on the current master version.

Ahead is my first esolang (well... that actually has progress). It borrows a lot of concepts from Befunge and ><> but hopefully it provides enough unique features to be interesting. I particularly want to provide features that can improve code density and golfing, one of which is included in this answer.

W is called "Writewhile". This pops cells from the stack and prints them as chars, until it encounters a 0. The 0 is popped and discarded (not printed). Since stringmode pushes a 0 to the stack when it starts, this makes printing strings rather easy.

"!dlroW ,olleH"    push chars to stack
W   pop and print until 0


Try it online!

# Haxe, 56 bytes

class H{static function main(){trace("Hello, World!");}}


Test it online!

# 2DFuck, 157 150 bytes

.!.!..!.!....!..!..!.!.!.x[!.!..!.!..!..rv].!..!.!....!..!.!.!..!....!.!......!.!.!.!.!...!.!..!.!....!.!...!..!.!..!..!.!..!...!..!..!.!....!.!....!.


Try it online!

Print He, print l twice, print o, World!

# 𒅴 𒆰, 21 bytes

𒁺("Hello, World!")


Try it online!

This is a language written in Cuneiform, and uses Sumerian words as keywords.

At its heart, this is just a translation of Python into Sumerian, but in the future there will be new features added, such as the Babylonian numeral system (which works in base 60).

Because it relies heavily on unicode, this is not going to be a very good golfing language.

• You could always translate from unicode to a golfier encoding :P – ASCII-only Dec 26 '18 at 0:10

# ESOPUNK, 191

COPY 72 #STDO
COPY 101 #STDO
COPY 108 #STDO
COPY 108 #STDO
COPY 111 #STDO
COPY 44 #STDO
COPY 32 #STDO
COPY 119 #STDO
COPY 111 #STDO
COPY 114 #STDO
COPY 108 #STDO
COPY 100 #STDO
COPY 33 #STDO


Can probably save some bytes by copying a constant to X, and ADDI/SUBI from it.

# Pixiedust, 153 bytes

++.*+..+...
++.*++..+.+
++.*++.++..
++.*++.++..
++.*++.++++
++.*+.++..
++.*+.....
++.*+.+.+++
++.*++.++++
++.*+++..+.
++.*++.++..
++.*++..+..
++.*+....+


Try it online!

## Explanation

Each line of the program is:

• ++ indicating that this line prints the following to STDOUT;
• .*, the portal register indicating a number literal; and
• A sequence of + and . characters forming the binary representation of the character to be printed.

# Kitten, 18 bytes

"Hello, World!"say


# Alchemist, 24 22 bytes

_->Out_"Hello, World!"
`

Try it online!