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.

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

## 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 ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 8478; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

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

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;

function getAnswers() {
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answers_hash[id] = a;
      if (!data.has_more) more_answers = false;
      comment_page = 1;

function getComments() {
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();


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

var OVERRIDE_REG = /^Override\s*header:\s*/i;

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

function process() {
  var valid = [];
  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
        body = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>';
    var match = body.match(SCORE_REG);
    if (match)
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
    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;
    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);

    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.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)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);

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

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;

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

table thead {
  font-weight: bold;

table td {
  padding: 5px;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/codegolf/all.css?v=ffb5d0584c5f">
<div id="language-list">
  <h2>Shortest Solution by Language</h2>
  <table class="language-list">
    <tbody id="languages">

<div id="answer-list">
  <table class="answer-list">
    <tbody id="answers">

<table style="display: none">
  <tbody id="answer-template">
    <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr>
<table style="display: none">
  <tbody id="language-template">
    <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr>

  • 2
    \$\begingroup\$ @isaacg No it doesn't. I think there would be some interesting languages where it's not obvious whether primality testing is possible. \$\endgroup\$ – Martin Ender Aug 28 '15 at 13:56
  • 6
    \$\begingroup\$ If the same program, such as "Hello, World!", is the shortest in many different and unrelated languages, should it be posted separately? \$\endgroup\$ – aditsu quit because SE is EVIL Aug 28 '15 at 15:33
  • 2
    \$\begingroup\$ @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. \$\endgroup\$ – Martin Ender Aug 28 '15 at 19:34
  • 8
    \$\begingroup\$ @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. \$\endgroup\$ – Martin Ender Aug 29 '15 at 23:01
  • 2
    \$\begingroup\$ @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. \$\endgroup\$ – user202729 May 20 '18 at 10:20

811 Answers 811

1 2
4 5

Packed 7-bit ASCII, 12


Since Markdown eats some of the characters, here's a hexdump:

$ xxd hello.ascii 
0000000: 9197 66cd eb10 57df cb66 4420            ..f...W..fD 

And yes, the trailing space is necessary.

Packed 7-bit ASCII is created by taking 8-bit ASCII (the normal kind), removing the high zero bit from each byte, packing the remainder, and then padding it out with trailing zero bits.

According to this site, this character encoding is used by "a specific US MIL STD message header format", making it a real thing.

  • 2
    \$\begingroup\$ Is Packed ASCII a programming language on its own right? \$\endgroup\$ – user3819867 Aug 30 '15 at 16:04
  • \$\begingroup\$ @user3819867 It's an edge case. It depends on definitions. \$\endgroup\$ – isaacg Aug 30 '15 at 16:19
  • \$\begingroup\$ Packed 7-bit ASCII is the encoding SMS uses \$\endgroup\$ – slebetman Sep 1 '15 at 4:31

Fortran, 28 bytes

print'("Hello, World!")'

You can't write print*,"Hello, World!" because there's a leading space in the default print format. Thus, we pass in our own format that simply contains a constant string.

  • \$\begingroup\$ Which version of Fortran is this? In F77 you'd need some spacing if I'm not mistaken. \$\endgroup\$ – Robert Benson Jul 19 '16 at 12:37
  • \$\begingroup\$ @RobertBenson F77 would also require fixed form if I'm not mistaken. In any case, this works in GFortran. tio.run/##S8svKilKzNNNT4Mw/v8vKMrMK1HXUPJIzcnJ11EIzy/… \$\endgroup\$ – Dennis Jun 6 '17 at 6:24
  • \$\begingroup\$ Yes, F77 is fixed format, so you'd need some tabs, which adds to byte-count :( \$\endgroup\$ – Robert Benson Jun 7 '17 at 15:10
  • \$\begingroup\$ GFortran: print*,"Hello, World!";end 26 bytes, but it prefixes a space char :( \$\endgroup\$ – roblogic Aug 27 '19 at 9:55

Cubix, 31 29 bytes

Saved 2 bytes thanks to @MartinBüttner


I proudly present Cubix, my new 2-dimensional, stack-based esolang. Cubix is different from other 2D langs in that the source code is wrapped around the outside of a cube.

Test it online! You can now adjust the iteration speed if you want it to run faster or slower.


The first thing the interpreter does is figure out the smallest cube that the code will fit onto. In this case, the edge-length is 3. Then the code is padded with no-ops . until all six sides are filled. Whitespace is removed before processing, so this code is identical to the above:

      . / v
      . o ;
      @ ? /
" ! d l r o W " S ' , u
/ " H e l l o " . . . .
. . . . . . . . . . . .
      . . .
      . . .
      . . .

Now the code is run. The IP (instruction pointer) starts out on the top left char of the far left face, pointing east. Here's an overview of the basic commands:

  • \|/_ are mirrors, and reflect the IP depending on the direction it's traveling.
  • >v<^ set the direction of the IP unconditionally.
  • ? turns the IP right if the top item is positive, or left if it's negative.
  • ' pushes the char code of the next char.
  • " toggles string mode, performing ' on each char until the IP encounters another ".
  • o outputs a char code.
  • ; pops an item.
  • @ ends the program.

The first char we encounter is ", which toggles string mode. Each char code is pushed to the stack until we run into the next ". Then we push a space with S, and a comma with ',. The stack now contains !dlroW ,.

Next we hit u, which turns the IP right, then right again before executing the next instruction. The IP is now at the far right of the fifth row in the above diagram, facing west. Now the IP executes "olleH", making the stack !dlroW ,olleH. The / points the IP south, where it travels through the bottom row of the bottom face, back up to the S (which adds an extra space), and finally hits the v.

Now the IP is in what I call the "output loop". First it moves down and hits the ;, which turns pops the unnecessary space. Then it hits the ?, which directs it through o to output, bounces back around to ; to pop the char, then comes back to ?.

This repeats until the stack is empty. Then, since the top of the stack is no longer truthy, ? leaves the IP headed north. The next char is @, which terminates the program.

I'm not sure if this program is optimal; there's four two no-ops which could probably be put to better use. Martin and I will keep looking to find a better solution.


BBC BASIC, 20 bytes

PRINT"Hello, World!"

Ahh, this was my first language :)

  • \$\begingroup\$ so BBC Basic does not accept ? as a shorhand for print? \$\endgroup\$ – edc65 Aug 28 '15 at 14:27
  • \$\begingroup\$ @edc65 I have no idea... I'll try \$\endgroup\$ – Beta Decay Aug 28 '15 at 14:28
  • \$\begingroup\$ @edc65 It doesn't work in BBC BASIC for Windows \$\endgroup\$ – Beta Decay Aug 28 '15 at 14:53
  • \$\begingroup\$ Strange, as it's quite standard in basic. A posted an answer as VBA \$\endgroup\$ – edc65 Aug 28 '15 at 14:59
  • 1
    \$\begingroup\$ @edc65, The "?" is NOT accepted, seems it conflicts with BBC Basic's PEEK() variant. But this is: P."Hello, World!" \$\endgroup\$ – user3710044 Mar 19 '17 at 8:31

Fission, 17 bytes

R"Hello, World!";


;"!dlroW, olleH"L

or any cyclic permutation of the two. In Fission, we need the R or L to release an atom and get control flow going. " toggles print mode, which just prints everything encountered until switched off. Finally ; destroys the atom to avoid an infinite loop.


Sed, 14 bytes

I'm hoping the sed exemption from no-input-rules applies here. If so, we can do:

cHello, World!

All that is required as input is one empty line.

  • \$\begingroup\$ cHello, World! \$\endgroup\$ – Mitch Schwartz Aug 28 '15 at 18:28
  • 1
    \$\begingroup\$ @MitchSchwartz excellent - I've never used the c sed command before - thanks! \$\endgroup\$ – Digital Trauma Aug 28 '15 at 18:56
  • \$\begingroup\$ Something like sed -e 'cHello, World!' <<<'' \$\endgroup\$ – F. Hauri Dec 9 '18 at 13:41

gs2, 2 bytes


where \x12 is a raw byte.


Z80Golf, 19 bytes

00000000: 674a 4343 4003 0f78 405d 434b 0e76 7e23  gJCC@..x@]CK.v~#
00000010: e5ee 2f                                  ../

Try it online!

Z80Golf is, essentially, a Z80 machine hooked up to $8000=putchar and $8003=getchar. The source code is a binary copied to $0000 (all other memory is zeroed out, just like the registers); execution starts there and runs until a halt instruction.

It was designed by mokehehe on anarchy golf for code golf competitions there, but seems to have fallen into disuse. It's really fun to golf in, but excelling in it requires a pretty thorough understanding of the Z80 chip (that I myself don't even have, but some golfers like kodera and *yuko* do, and every solution they write is very clever.)

A naïve Hello, World! program might look like this:

  ld a, (ix+hello)
  or a
  jr nz, okay
  call $8000  ; putchar
  inc ix
  jr start
  db "Hello, World!"

It assembles into a 27 byte binary. It even cheats a little bit: we don't need to explicitly zero-terminate the string "Hello, World!" ourselves, as all the memory past our source code is zeroed already. And it's still a fair bit longer than our 19-byte solution.

So how does the 19-byte solution work?

It doesn't look much like a Hello, World! program when disassembled:

  ld h,a
  ld c,d
  ld b,e
  ld b,e
  ld b,b
  inc bc
  ld a,b
  ld b,b
  ld e,l
  ld b,e
  ld c,e
  ld c,0x76
  ld a,(hl)
  inc hl
  push hl
  xor 0x2f

We can look at the program in a slightly more revealing manner.

  db 47 ^ 'H'  ; 67  ld h, a
  db 47 ^ 'e'  ; 4a  ld c, d
  db 47 ^ 'l'  ; 43  ld b, e
  db 47 ^ 'l'  ; 43  ld b, e
  db 47 ^ 'o'  ; 40  ld b, b
  db 47 ^ ','  ; 03  inc bc
  db 47 ^ ' '  ; 0f  rrca
  db 47 ^ 'W'  ; 78  ld a, b
  db 47 ^ 'o'  ; 40  ld b, b
  db 47 ^ 'r'  ; 5d  ld e, l
  db 47 ^ 'l'  ; 43  ld b, e
  db 47 ^ 'd'  ; 4b  ld c, e
  db 47 ^ '!'  ; 0e  ld c,
  halt         ; 76        $76
  ld a, (hl)
  inc hl
  push hl
  xor 47
               ; 32749 nop instructions, and then:
               ; putchar(A)
               ; ret

Whenever the PC becomes $8000, Z80Golf is programmed to write the byte in register A to STDOUT, and then effectively execute a ret (the PC is set to (SP) and SP is incremented by 2). In our code, instead of using call $8000 to access this behavior, we let the PC wade through a sea of nops (opcode 00) from $0013 to $7fff.

Keeping this in mind, the code will run as follows:

  • Execute some meaningless instructions (effectively NOPs), starting from ld h,a.
  • Set A to mem[0] ^ 47, which is 'H'.
  • Increment HL and push it ($0001).
  • Fall through to putchar, and return to the $0001 we pushed.
  • Execute some meaningless instructions, starting from ld c,d this time.
  • Set A to mem[1] ^ 47, which is 'e'.
  • Increment HL and push it ($0002).
  • Fall through to putchar, and return to the $0002 we pushed.
  • Set A to mem[12] ^ 47, which is '!'.
  • Fall through to putchar, and return to the $000d we pushed.
    • We finally jump into the argument of the ld c, $76 — and $76 is the halt opcode!

Of course, the constant 47 was carefully picked so that none of the first instructions 13 influence the execution of the code, and the last one is some opcode that takes a single-byte argument, “hiding” the halt opcode until we jump there after printing '!'.


PDP-11 (Unix) Assembly, 33 38 bytes

Source (No trailing newline required):

sys 4;10;15;sys 1;<Hello, World!>

Binary output:

0000000 000407 000026 000000 000000 000000 000000 000000 000000
0000020 104404 000010 000015 104401 062510 066154 026157 053440
0000040 071157 062154 000041 000000 000000 000000 000000 000000
0000060 000000 000000 000000 000000 000000 000000

The output is zero-padded to 60 bytes for some reason, but I know enough about the architecture to know that it doesn't matter and can be considered 38 (maybe 37) bytes. Unfortunately, while this works on the terminal, it actually prints to STDIN.

So, a correct program (I believe it exits with status 1, but that's not important) is:

5200;sys 4;12;15;sys 1;<Hello, World!>

That 5200 in the beginning is actually an "inc r0" instruction, but writing it in octal is shorter. Coincidentally, the length of this source code is also 38 bytes.

0000000 000407 000030 000000 000000 000000 000000 000000 000000
0000020 005200 104404 000012 000015 104401 062510 066154 026157
0000040 053440 071157 062154 000041 000000 000000 000000 000000

Output clocks in at 20 non-zero words, or 39 non-zero bytes, and this time the assembler doesn't insert quite as much padding so the actual output file size is 48 bytes.

Unobfuscated source for the same program:

inc r0
sys write; 0f; 13.
sys exit
0: <Hello, World!>

If you actually assemble this source the output has an extra nonzero byte (value 2) in the second-last word of the output, probably something to do with the fact that named symbols were used for the system calls.

  • \$\begingroup\$ So is your answer optimized for short machine code, or for short source? Or both? Maybe post two header lines, one for the machine-code count and one for the asm source count? \$\endgroup\$ – Peter Cordes Apr 13 '18 at 0:52

GNU Make, 27

$(info Hello, World!)
  • \$\begingroup\$ You can stick these two lines together, in either order, on one line to eliminate one more char. \$\endgroup\$ – user3710044 Mar 19 '17 at 8:48

C#, 85 67 bytes

class P{static void Main(){System.Console.Write("Hello, World!");}}

I guess it cannot get worse. Did not even beat Java this time.

  • 7
    \$\begingroup\$ class P{static void Main(){System.Console.WriteLine("Hello, World!");}} -- 71 bytes. More golfing you must do young padawan. \$\endgroup\$ – Stephan Schinkel Aug 28 '15 at 13:36
  • 7
    \$\begingroup\$ You don't need to specify the accessibility modifiers, C# will use defaults so you can remove both instances of public . You can also use the Write method on Console to save a few more bytes. \$\endgroup\$ – user20151 Aug 28 '15 at 13:36
  • 4
    \$\begingroup\$ The newline in the output is optional, so use Write instead of WriteLine to save 4 bytes \$\endgroup\$ – SLuck49 Aug 28 '15 at 15:49
  • \$\begingroup\$ Yeah, a lang of Microsoft is worse than Java! \$\endgroup\$ – univalence Jul 18 '16 at 18:23

Carrot (version: ^3), 13 bytes

Carrot is a language of Κριτικσι Λίθος. The syntax is stack^commands, where the stack is a string, and the interpreter outputs everything that's on the stack at the end of the program. The carrot is optional if you have no commands.

Hello, World!

In version ^, the carrot wasn't optional yet if you had no commands, so then it was 14 bytes:

Hello, World!^
  • 1
    \$\begingroup\$ +6 carrot.png \$\endgroup\$ – Addison Crump Nov 1 '15 at 18:11
  • \$\begingroup\$ Write the version number as "^". \$\endgroup\$ – user41805 Nov 2 '15 at 5:51
  • \$\begingroup\$ @ΚριτικσιΛίθος Sure! Done. \$\endgroup\$ – ProgramFOX Nov 2 '15 at 6:40
  • \$\begingroup\$ Version ^3 makes the ^ optional is you do not want to use any commands. Thus this can be shortened down by one byte. \$\endgroup\$ – user41805 Nov 3 '15 at 8:40
  • \$\begingroup\$ @ΚριτικσιΛίθος Cool! Added that. \$\endgroup\$ – ProgramFOX Nov 3 '15 at 8:43

VSL, 35 33 bytes

Saved 2 bytes thanks to @ASCII-Only

fn main(){print("Hello, World!")}

Try it online!

Okay after over one year development, the day has come where I can post this :D

There is a print("Hello, World!") function but this is shorter. As I seperate libc and libvsl this will probably have to switch over to print but for now this is the shortest.

  • \$\begingroup\$ Using fn can save two bytes \$\endgroup\$ – ASCII-only Apr 11 '18 at 3:16

Lost, 57 54 45 bytes

Two bytes saved thanks to @MartinEnder

>%?"Hello, WorldvU"-+@

Try it online!


Lost is a 2 dimensional language in which the start location and direction are entirely random. As you might imagine it is rather difficult to write deterministic programs in lost. However the language has a couple of design features that allow for deterministic programs to be written.

Here's how this one works:

I'll first give you some information on the operations in Lost that are important here, so you don't have to read the github. I will leave out the more obvious ones.

  • @ exits, but only if the "safety" is off. The safety begins on.

  • % turns the safety off.

  • ? Pops the TOS and jumps if it is non-zero.

  • ! jumps unconditionally.

  • ( pops a value and saves it for later.

Ok now we are read to dive in.

The main code is the following line

"Hello, WorldvU"-+@

This pushes the string Hello, WorldvU, subtracts the U from the v to get a !, and then terminates the program (we assume the safety is off)

However we have to get to this program so we create a line of arrows to catch the randomly moving pointers

>%"Hello, WorldvU"-+@

We also add a % to turn the safety off once we have corralled the programs. We can now see that the v is in the string to redirect ips that start inside the string.

Our last problem is that we sometimes accumulate garbage we don't want in our final product before we arrive at the start of execution. To fix this we just eat everything on the stack that is not zero (this only works because the garbage never contains a zero).

>%?!<"Hello, WorldvU"-+@

The code >&?!< acts our loop, discarding values until it discards a zero.

This doesn't work because the ! can jump to itself over the top or bottom of the program when the ip starts on it moving either up or down. This will cause an infinite loop (this is the same reason we didn't include ! in the original Hello, world! string). We can fix two ways. The first way, which works in most scenarios, is to another stream below to catch this specific pointer.

>%?!<"Hello, WorldvU"-+@

With this new stream our program has now covered all the possibilities and is deterministic.

However if we want to be a bit more clever and save a few bytes we can do away with ! entirely. We replace our loop with <%?.

>%?"Hello, WorldvU"-+@

Since there is a v later on the line which sends us back to the beginning of the loop our ? will reset the loop if the top of the stack is non-zero, while if it is zero it will hit " and complete the program as intended.

Lastly I reversed some of the upper stream. This just makes the program a little faster, doesn't lose me any bytes so why not.


Javascript, 22 bytes

alert("Hello, World!")

You don't NEED semicolons in Javascipt!

  • \$\begingroup\$ Don't you need them? \$\endgroup\$ – OldBunny2800 Apr 14 '16 at 21:19
  • \$\begingroup\$ Apparently not for 1 liners (I don't know JS golfably) \$\endgroup\$ – Blue Apr 14 '16 at 21:21
  • 1
    \$\begingroup\$ The JS interpreter will automatically insert them where it thinks they should be, if they aren't present \$\endgroup\$ – MayorMonty May 8 '16 at 22:54
  • \$\begingroup\$ It does not print to stdout like the spec says \$\endgroup\$ – Valentin Lorentz Jun 1 '16 at 19:45
  • 2
    \$\begingroup\$ @ValentinLorentz Javascript doesn't have a stdout - I used the nearest alternate; see Default for Code Golf: Input/Output methods \$\endgroup\$ – Blue Jun 1 '16 at 19:48

Mouse, 19 bytes

"Hello, World"33!'$

Oddly enough, ! inside of a string makes a newline, so we have to work around that by getting the ASCII code for !, which is 33, and outputting that as a character.


Pancake Stack, 1118 1073 bytes

Put this supercalifragilisticexpialidociouseventhoughthesoundofitissomethingquite pancake on top!
Show me a pancake!
Put this floccinaucinihilipilification pancake on top!
Put the top pancakes together!
Show me a pancake!
Put another pancake on top!
Put this piquant pancake on top!
Put the top pancakes together!
Show me a pancake!
Show me a pancake!
Put another pancake on top!
Put this big pancake on top!
Put the top pancakes together!
Show me a pancake!
Put this osteosarchaematosplanchnochondroneuromuelous pancake on top!
Show me a pancake!
Put this kolmivaihdekilowattituntimittari pancake on top!
Show me a pancake!
Put the top pancakes together!
Put this scrumptious pancake on top!
Put the top pancakes together!
Show me a pancake!
Eat the pancake on top!
Show me a pancake!
Put this big pancake on top!
Put the top pancakes together!
Show me a pancake!
Eat the pancake on top!
Show me a pancake!
Eat the pancake on top!
Take off the syrup!
Show me a pancake!
Put this nonilfenossipolietilenossietonolo pancake on top!
Show me a pancake!
Eat all of the pancakes!

I've been avoiding this one because I haven't found a good way of golfing it yet, but here's a submission for now.

The relevant operations are:

Instruction                               Result
Put this X pancake on top!                Push word length of X to stack
Eat the pancake on top!                   Pop and discard
Put the top pancakes together!            Add top two
Put another pancake on top!               Duplicate
Show me a pancake!                        Print as ASCII without popping
Take off the syrup!                       Decrement all stack values by 1
Eat all of the pancakes!                  Terminate program

If you take a look a Pancake Stack's full instruction set, you'll notice that you only ever have access to the top two stack elements at any time, which makes this language a pain to program in normally. That and the fact that you can only output as ASCII, i.e. no numeric output.

Note that, if you're using the Python interpreter, you'll need an extra line with a ~ afterwards if you want to test by piping in a file. We don't use it here, but anything after the ~ is treated as normal STDIN input.


???, 96 bytes


Based on the 95-byte approach by Mitch Schwartz.

Note that the 92-byte Brainfuck solution would yield 97 bytes in ???, because the sequential loops require four more apostrophes.

  • 24
    \$\begingroup\$ This is... wait, wrong challenge. \$\endgroup\$ – Dennis Aug 29 '15 at 4:38
  • \$\begingroup\$ 80 bytes \$\endgroup\$ – ASCII-only Apr 12 '18 at 5:24

Ziim, 1222 bytes

In an unexpected turn of events, I'm counting this submission in UTF-16.

↘ ↓↘↘↘↘↙↓↘↘ ↙↓↘ ↓↘ ↙↘←↓ ↘↘↙↓↘↘↘↙↓↘↘↘↘↙↓↘↘↘↘↙↓ ↘↘↙↓↘↘↙↓↘ ↙ ↘ ↓↘ ↙↘←↓↘ ↙ ↘ ↓ ↘↘↙↓↘↘↙↓↘↘↘↘↙↓ ↘ ↙↘←↓↘ ↙ ↘ ↓ ↘ ↙ ↘ ↓↘↘↙↓↘↘↘↙↓↘↘↘↙↓↘↘ ↙↓↘←↓↘ ↙↓↘ ↓↘↘↙↓ ↘↘↙↓↘↘↙↓↘ ↙↘←↓↘ ↙↘←↓ ↘ ↙↘←↓ ↘↘↙↓↘↘↙↓ ↘ ↙ ↘ ↓↘↘ ↙ ↘ ↓↘ ↙↓↘←
↓→↘ ↑↑↓→↘ ↑↓  ↓→↘ ↓↓↓→↘↘ ↓→↘ ↑↓→↘ ↑↑↓→↘ ↑↑↓→↘↘ ↓→↘ ↓→↘ ↓↓↓↓→↘ ↓↓↓→↘ ↓↓↓↓→↘↘ ↓→↘ ↓→↘ ↑↑↓→↘↘ ↓↓↓→↘ ↓↓↓↓→↘↘ ↓↓↓↓→↘ ↓→↘ ↑↓→↘ ↑↓→↘ ↑↓  ↓→↘ ↓  ↓→↘ ↓→↘↘ ↓→↘ ↓→↘ ↓↓↓→↘ ↓↓↓→↘↘ ↓↓↓→↘↘ ↓→↘ ↓→↘↘ ↓↓↓↓→↘ ↑↓↓↓↓→↘ ↓  ↓→
↗  ↑↖ ↗  ↑↖↗↑↗↗  ↑↗↗↗  ↑↑↗  ↑↖↗  ↑↖ ↗  ↑↖ ↗  ↑↑↗  ↑↗  ↑↗↗↗↗  ↑↗↗↗  ↑↗↗↗↗  ↑↑↗  ↑↗  ↑↖ ↗  ↑↑↗↗↗  ↑↗↗↗↗  ↑↑↗↗↗↗  ↑↗  ↑↖↗  ↑ ↗  ↑↖↗↑↗↗  ↑↗↑↗↗  ↑↗  ↑↑↗  ↑↗  ↑↗↗↗  ↑↗↗↗  ↑↑↗↗↗  ↑↑↗  ↑↗  ↑↑↗↗↗↗  ↑↖↗↗↗↗  ↑↗↑↗↗

Because the code snippet above will likely not render in a very readable manner for you (either because of missing characters, or because the diagonal arrows aren't as monospaced as they should be), here is an image of the solution. I've marked the concatenators where a new byte starts in red:

enter image description here
Click for larger version

Well, this is a bit embarrassing. I spent quite some time on this solution, and at 610 characters, it is 267 characters shorter than the one on the esolangs page. However, it contains a lot more arrows, and because those are 3 bytes in UTF-8, it's actually longer than the one on esolangs (1516 vs 1345). But because this solution is so dense and contains far more arrows than spaces, I'm actually saving bytes by using UTF-16 and counting each character as two bytes.

Anyway, regardless of how we're counting, this is far from optimal. The above code is entirely linear, and builds one bit at a time. So I'm not reusing any bitstrings (like I could for the ls or os or even other substrings). I chose this approach because I wanted to start with something where it would be easier to pack the arrows very densely. If one used a more square layout, one could make use of a lot more repetition in the output (on a bit level), and thereby make massive savings.

  • \$\begingroup\$ Most 2d languages are generally scored by the area of the bounding box, why not do that here? \$\endgroup\$ – SuperJedi224 Jan 29 '16 at 17:31
  • \$\begingroup\$ @SuperJedi224 [citation-needed]? I've never scored any 2D language like that and the only one which I've seen like that is Piet where I think that's not how we should do it. \$\endgroup\$ – Martin Ender Jan 29 '16 at 17:40
  • \$\begingroup\$ I've definitely seen befunge and <>< scored that way before, and that's how I've generally been scoring BotEngine. \$\endgroup\$ – SuperJedi224 Jan 29 '16 at 17:56
  • 2
    \$\begingroup\$ @SuperJedi224 if I saw that I would recommend changing it. Programs should be scored by the size of the source file and I don't know any 2D language that chokes on omitted trailing spaces. Plus, if a submission did use up the entire bounding box, you wouldn't be counting any bytes for the aspect ratio of the grid, which is also important information. \$\endgroup\$ – Martin Ender Jan 29 '16 at 18:11

Foo, 14 bytes

"Hello, World!

Not printing Hello World seems to be a lot harder in Foo that the opposite...

Try it online!

  • \$\begingroup\$ Would s print Hello World? ;) \$\endgroup\$ – OldBunny2800 Apr 14 '16 at 21:18
  • \$\begingroup\$ Probably. \$\endgroup\$ – Dennis Apr 14 '16 at 21:20
  • \$\begingroup\$ If you find out, you might be able to golf it down to 0 or 1 byte! \$\endgroup\$ – OldBunny2800 Apr 14 '16 at 21:22

Labyrinth, 46 45 40 bytes


Try it online!

Labyrinth is my new two-dimensional programming language (although the 2D'ness isn't really used here). Labyrinth operates on two stacks (although this code only uses one). Each character is a separate command. However, as opposed to most similar languages individual digits don't push that digit (which makes it annoying to build up larger numbers), instead they multiply the top of the stack by 10 before adding themselves. This allows you simply to write out the numbers you want to push. (Another language with this concept is Emmental.)

The other commands you need to know for the above code are . which prints the top of the stack (modulo 256), : which duplicates the top of the stack, ) which increments it and # which pushes the current stack depth. @ terminates the program. There's only one tricky part: W is printed by appending a 1 to 111 (o), because 1111 % 256 = 87.

Here is what the stack and output look like throughout the program:

Command(s)  Stack               Output
72          [72]                ><
.                               >H<
10          [10]                >H<
:           [10 10]             >H<
1           [10 101]            >H<
.           [10]                >He<
:           [10 10]             >He<
8           [10 108]            >He<
:           [10 108 108]        >He<
..          [10]                >Hell<
:           [10 10]             >Hell<
)           [10 11]             >Hell<
:           [10 11 11]          >Hell<
1           [10 11 111]         >Hell<
:           [10 11 111 111]     >Hell<
.           [10 11 111]         >Hello<
#           [10 11 111 3]       >Hello<
2           [10 11 111 32]      >Hello<
#           [10 11 111 32 4]    >Hello<
4           [10 11 111 32 44]   >Hello<
..          [10 11 111]         >Hello, <
:           [10 11 111 111]     >Hello, <
1           [10 11 111 1111]    >Hello, <
..          [10 11]             >Hello, Wo<
4           [10 114]            >Hello, Wo<
.           [10]                >Hello, Wor<
:           [10 10]             >Hello, Wor<
8           [10 108]            >Hello, Wor<
.           [10]                >Hello, Worl<
0           [100]               >Hello, Worl<
.           []                  >Hello, World<
33          [33]                >Hello, World<
.           []                  >Hello, World!<
  • 1
    \$\begingroup\$ This maybe could be golfed more if you allow the code to intersect itself. \$\endgroup\$ – TheNumberOne Aug 29 '15 at 14:24
  • \$\begingroup\$ I really don't understand why "1111" is a "W". The ascii code for 'W' is 87. Can somebody explain this to me? \$\endgroup\$ – Robert Hickman May 25 '17 at 15:29
  • \$\begingroup\$ Oh, I see the explanation in the description, but I wasn't aware that . did a % 256 before printing. \$\endgroup\$ – Robert Hickman May 25 '17 at 15:41

ELF 32-bit LSB executable (Linux), 59 bytes

0000000: 7f 45 4c 46 01 00 00 00 00 00 00 00 00 90 43 0d  .ELF..........C.
0000010: 02 00 03 00 19 90 43 0d 19 90 43 0d 04 00 00 00  ......C...C.....
0000020: b9 2e 90 43 0d b2 0d cd 80 cc 20 00 01 00 48 65  ...C...... ...He
0000030: 6c 6c 6f 2c 20 57 6f 72 6c 64 21                 llo, World!

This exits with INT 3 (breakpoint), so your shell may display a message to indicate this. However, the program itself prints nothing to STDERR.

Try it online!


$ cksum hw32
3205536342 59 hw32
$ ./hw32
Hello, World!Trace/breakpoint trap
$ ./hw32 | cat; echo
Hello, World!
$ ./hw32 | xxd -g 1
0000000: 48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21           Hello, World!
  • \$\begingroup\$ or echo $(./hw32) \$\endgroup\$ – F. Hauri Dec 9 '18 at 13:53

LLVM IR 4.0.1, 149 145 152 bytes

declare i8@puts(i8*)@t=global[14 x i8]c"Hello, World!\00"define void@main(){call i8(i8*)@puts(i8*getelementptr([14 x i8],[14 x i8]*@t,i1 0,i1 0))ret void}

I'm not very good in LLVM IR, so chances are good, that it's possible with fewer bytes.

Ungolfed Version:

declare i8 @puts(i8*) ; Declare puts from C standard. i8, was the shortest return type possible.

@t=global [14 x i8] c"Hello, World!\00" ; Hello world string as global, to have a pointer to it.

define void @main(){
    call i8(i8*) @puts(i8* getelementptr([14 x i8], [14 x i8] *@t, i1 0, i1 0)) ; Get pointer to constant "Hello, World!" and pass it to puts
    ret void
  • \$\begingroup\$ would int main be smaller, with ret 0 instead of ret void? I don't know LLVM IR at all, really >.< \$\endgroup\$ – Peter Cordes Apr 13 '18 at 0:54
  • \$\begingroup\$ You can put a raw null byte instead of \00, do call i8@puts, and use [14x i8] to save space \$\endgroup\$ – EasyasPi Dec 30 '20 at 20:39

Hexagony, 30 29 bytes


Try it online!

Source laid out:

    H ; _ e
   ; r ; 2 l
  . ; P . Q W
 ; l / P 1 ; @
  ; 0 d ; \ o
   ; . . . .
    . . . .

One more byte off!

Here's a crappy gif of the program in action.

29 byte gif

Given there's 2 nops inside the program itself, I'm confidant this can be golfed by at least one more byte. I'm willing to offer a bounty for a smaller version.

Old version:


Try it online!

Source laid out:

    H ; e ;
   r ; 0 P l
  d ; P _ 1 ;
 l ; ; o ; Q \
  ; W \ ; $ 2
   @ \ . . .
    . . . .

Reuses the same tricks as Martin Ender's answer, i.e Q2 printed is the comma, P0 is the space, P1 is the bang, but manages to be 2 bytes shorter through clever mirroring to reuse several ;s and the o.


Here's a coloured Hexagony grid to show the non-branching path that the pointer takes:

30 byte path

The executing code, ignoring mirrors, is:


Filtering out the skipped instructions and the literals that are overwritten by other literals, we are left with:


Which simply prints "Hello, World!"

After a few attempts, I gave up on a size 3 Hexagony answer. You need a minimum of 12 instructions out of 19 reserved for string literals, along with three ;s for printing and one @ for ending the program. This leaves only 3 spaces for IP management and memory management, provided you find the optimal path that reuses both the o and the l. From all this, I'll rule that a size 3 answer is impossible, though I'll give a sizable bounty to anyone who proves me wrong.

  • 1
    \$\begingroup\$ I posted a shorter solution. \$\endgroup\$ – user202729 May 19 '18 at 13:55
  • 1
    \$\begingroup\$ I came up with a 25-byte solution by hand - this will be my first answer here! I'm a bit miffed now to find this has already been beaten, albeit by brute force. Up until half an hour ago i thought Martin's original post was the only one for Hexagony. Still, my approach is different from the others. Hope to post soon although it may have to wait till Saturday when I get back from vacation and have access to my computer again. \$\endgroup\$ – Oliphaunt - reinstate Monica Aug 22 '18 at 20:29
  • \$\begingroup\$ @Oliphaunt It's been a while, but I noticed you never posted your 25 byte solution. Do you still have it or remember it? \$\endgroup\$ – Jo King Sep 26 '19 at 2:51

R, 20 bytes

cat("Hello, World!")

Prelude, 38 bytes


If you're using the Python interpreter, you'll need to make sure that NUMERIC_OUTPUT is set to False.

Prelude is a relatively simple stack-based language, with 0-9 pushing the corresponding single digits and the only arithmetic being addition and subtraction. In particular, there is no multiplication.

To make the most of the single digit pushing behaviour, I took a look at the code points in various bases. For base 12, we get this:

[[6 0] [8 5] [9 0] [9 0] [9 3] [3 8] [2 8] [7 3] [9 3] [9 6] [9 0] [8 4] [2 9]]

Everything here is a single digit - that's perfect! This means that we can encode each character using two digits via base 12, e.g. H -> 72 (base 10) -> 60 (base 12). That's what the long string of 26 digits at the beginning is for.

The back half of the code then needs to take each pair of digits a, b and give 12*a+b. But remember, Prelude doesn't have multiplication! What it does have, however, is ^ and v, which get the top stack values from the program rows ("voices") above and below. Since this is a one-line program, ^ effectively duplicates the top of the stack, allowing us to do ^+^+^^++ to multiply the top stack element by 12. We then add the second digit with + and output with !. All of this is wrapped in (), which is a BF-like loop which executes while the top stack element is nonzero.


Emotinomicon, 18 characters / 30 bytes

Try it here.

😭!dlroW ,olleH😲⏪⏬⏩


😭  !dlroW ,olleH   😲  ⏪   ⏬   ⏩   explanation
😭                                   begin quote string
    !dlroW ,olleH                   
                    😲               end quote string
                        ⏪           open loop
                            ⏬       pops and outputs top of stack as character
                                ⏩   close loop

ELF 64-bit LSB executable (Linux), 104 bytes

0000000: 7f 45 4c 46 02 01 01 03 b0 04 b3 01 b2 0e eb 18  .ELF............
0000010: 02 00 3e 00 01 00 00 00 08 00 40 00 00 00 00 00  ..>.......@.....
0000020: 30 00 00 00 00 00 00 00 b9 48 00 40 00 90 eb 30  0........H.@...0
0000030: 01 00 00 00 01 00 38 00 01 00 00 00 00 00 00 00  ......8.........
0000040: 01 00 40 00 00 00 00 00 48 65 6c 6c 6f 2c 20 57  ..@.....Hello, W
0000050: 6f 72 6c 64 21 0a 00 00 6f 72 6c 64 21 0a 00 00  orld!...orld!...
0000060: cd 80 b0 01 b3 00 cd 80                          ........

This sets as many proper headers as possible without affecting the byte count, prints a trailing linefeed and exits cleanly with exit code 0.

Try it online!


$ cksum hw64
3288151474 104 hw64
$ file hw64
hw64: ELF 64-bit LSB executable, x86-64, version 1, statically linked, corrupted section header size
$ ./hw64
Hello, World!
$ echo $?
  • \$\begingroup\$ Disassembly output of the code stuffed into the ELF headers would be nice, if you needed any special tricks to make instruction bytes also be valid ELF headers. (Future readers: see muppetlabs.com/~breadbox/software/tiny/teensy.html for more about this kind of hack.) \$\endgroup\$ – Peter Cordes Apr 13 '18 at 0:57
  • \$\begingroup\$ O_o why is there an extra orld! \$\endgroup\$ – ASCII-only Apr 13 '18 at 4:55
  • \$\begingroup\$ @ASCII-only The answer saves bytes by storing data in the ELF's program header. The longs at 0x50 and 0x58 encode the virtual and physical addresses of the segment, and they program segfaults if they do not match. \$\endgroup\$ – Dennis Apr 13 '18 at 5:26

USML, 9 bytes


Try it online!


S0h7       # Get characters 0-7 of h ("Hello, world!").
    cW     # Get the character "W"
      s8h  # Get the remaining characters, starting at character 8, of h.

This program is an interesting problem, as it has a command that outputs "Hello, world!" (and an empty program will also do this), but the capitalization is not correct. As a result, we need to take some substrings and add in the correct character.

  • 7
    \$\begingroup\$ This is probably the first interesting use of a HW-built-in I've seen in this challenge. \$\endgroup\$ – Martin Ender Apr 8 '17 at 22:15

INTERCAL, 285 bytes

PLEASE DO,1SUB#4<-#256
PLEASE DO,1SUB#10<-#168
PLEASE DO,1SUB#13<-#162

Try it online!

1 2
4 5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.