# “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

# Mathematica, 21 bytes

Print@"Hello, World!"


# Mathemaica 10.3, 20 bytes

Echo@"Hello, World!"

• Feel free to count the 10.3 version as the main solution and include the older one for reference. – Martin Ender Nov 10 '15 at 13:38

# Kotlin, 49 bytes

fun main(a:Array<String>){print("Hello, World!")}


This is a programming language created by JetBrains to overcome the limitations of Java (like Scala), be fast (like Java itself) and yet retain full interoperability with Java. This means that Kotlin can easily call Java code ... and vice versa.

# Arcyóu, 18 15 bytes

"Hello, World!"


Arcyóu is a LISP-like golfing language. Since this is the only thing in the program, we don't need a p function or even parentheses. Just quotes.

• No need for the disclaimer here. Newer languages are allowed and even encouraged this time. – Martin Ender Nov 22 '15 at 15:11

## AutoHotkey, 61 bytes

DllCall("AllocConsole")
FileAppend % "Hello, World!", CONOUT$ AHK was written to automate Windows tasks and it seems as if the authors considered StdOut/In as an after thought. This is the shortest method I could come up with. When executed the console will flash with Hello World! and exit immediately, it would require additional code (either adding a Hotkey or #persistent or sleep command) to keep the console active, however I feel this does the job and meets the requirements. I could also make the program with DLLCall("AttachConsole, Int, -1") so that it can be executed from the command line and write to the same console it was executed from, however this code golf. • Greetings from the future! I can't tell if this worked at the time but it works now and its 27 bytes: FileAppend,Hello, World!,* – Engineer Toast Apr 5 '17 at 15:53 ## Hodor, 66 bytes hodor.hod("Hhodor? Hodor!? Hodor!? o, Hooodorrhodor orHodor!? d!")  This only works in the previous version of Hodor (the one before the update from 1 July 2015). The latest version prints HODOR instead, which could be fixed at the cost of 3 bytes: hodor.hod("Hhodor? Hodor!? Hodor!? o, Hooodorrhodor orHodor!? "+"d!")  ## TRANSCRIPT, 36 bytes He is here. >HE, Hello, World! >X HE  The second line sets HE, and the third line outputs it. • I was initially going to post this, but for some reason I kept getting errors whenever I tried to use single-char NPC names... – Sp3000 Sep 1 '15 at 13:02 • @Sp3000 You're right, I just looked at the interpreter and found that it only matches two-letter words or longer. – LegionMammal978 Sep 1 '15 at 21:15 • @LegionMammal978 You should use He. – mbomb007 Sep 1 '15 at 21:55 ## Seriously 0.1, 1 byte H  Try it online Yes, I made my language have a one-byte Hello World program. A less boring answer for 16 bytes: "Hello, World!".  "Hello, World!" pushes that string onto the stack, and . pops the top value on the stack and prints it. ## Par, 14 bytes Hello, World!  I don't know Par, but it looks golfy. ## Templates Considered Harmful, 50 bytes St<72,'e','l','l','o',44,32,87,'o',114,'l','d',33>  Templates Considered Harmful is a language defined by C++ templates. The St template creates a string of characters, which is then implicitly printed to STDOUT. # Factor, 17 21 bytes Push a string, then print it without quotes. "Hello, World!" print  # Jolf, 14 bytes "Hello, World!  Records a string, implicit output. Try it here. ## Jolf, 9 bytes, cheating (unprintable chars replaced with ?): e.$nsp#0?
e         evaluate as Jolf code
.         from the object
$# nsp, get 0 property 0 ? (08, backspace character; restrain implicit output)  nsp is an object on the interpreter page that contains example programs. The zeroth one is the Hello, World! program. Try it here. • This is a catalogue, is it not? Therefore, this answer is completely valid. – SuperJedi224 Dec 15 '15 at 23:13 • @SuperJedi224 Indeed, yes. Fixing. – Conor O'Brien Dec 15 '15 at 23:14 ## Eodermdrome, 18 bytes al(Hello, World!)a  Replaces the a - l edge on the initial graph with the a node, and outputs Hello, World! in the process. • Hi, your program works, but not for the reason you think - it actually matches the o-g edge, because the l in your program must represent a node with only one outgoing edge. – Ørjan Johansen Apr 18 '17 at 1:41 ## BASIC-80, 16 bytes BASIC-80 aka MBASIC does not need a trailing " to end string constants at the end of the line, so... 1?"Hello, World!  ...is all you need. CP/M nostalgia... A>mbasic BASIC-80 Rev. 5.21 [CP/M Version] Copyright 1977-1981 (C) by Microsoft Created: 28-Jul-81 32824 Bytes free Ok 1?"Hello, World! run Hello, World! Ok system A>_  ## ROOP, 17 bytes "Hello, World!" h  At the beginning an object is created with the string that is in quotation marks, then the h operator prints all existing objects and ends the program. ## X.so, 48 42 bytes $A($Main("X"Include"Hello, World!"X.Show))  Requires XCore to run, so it can use the X.Show command. # Visual Basic.NET, 63 bytes Module A Sub Main System.Console.Write("Hello, World!") End Sub End Module  ## JavaScript function golf, 19 bytes p("Hello, World!");  I made this[1] for you! JavaScript function golf is included into the language page HTML, so use it right from the console! If you want it as an alert, here you are (21 byte): p2a("Hello, World!");  That said, I finally got time for improvement of the framework. [1]: I mean, the language golfing framework. • Welcome to PPCG. This is a good start for a Golfing language, however there a lot of features of JavaScript, like Prototypes, that you might want to take advantage of (e.g. 42.s() could turn a number into a string instead of i2s(42).) If you want help or tips, feel free to visit chat.stackexchange.com/rooms/27364/… for help, tips and showcasing your language. – wizzwizz4 Jan 2 '16 at 12:39 • @wizzwizz4 thanks, but my real introduction to PPCG was a question. :P Also, I have still to learn about prototypes, and I'm not active enough to chat in the PPCG rooms. – user48538 Jan 2 '16 at 12:43 • @wizzwizz4 42.s() is a syntax error in some js engines, you'd have to do (42).s() which doesn't actually save anything – SuperJedi224 Jan 2 '16 at 14:49 • @SuperJedi224 That was an example. :-P – wizzwizz4 Jan 2 '16 at 15:19 • @zyabin101 You don't need much reputation to chat. – wizzwizz4 Jan 2 '16 at 15:19 # Boo, 22 bytes The guys who came up with “public static void main” were probably kidding, the problem is that most people didn't get it was a joke. The infamous HelloWorld in all its boo glory: print("Hello, World!")  “public static void main”, that was a good one! # Brachylog, 3 bytes @Hw  @H is the string "Hello, World!", and w is the write predicate. # Jolf, 7 bytes Try it here! ξrμ\t\x0FΉ\x1B  ξ read three characters and interprets them as a base 256 number index in a gigantic word list. 'Nuff said. # Detour, 19 bytes u @"Hello, World!"  Try it online! This language was not designed with strings in mind. "How do you fit a string literal into a 2D language represented on a grid of characters?" You don't! Just put a , and then define what the 's stand for on the bottom with @ signs (sigh)! This will push all its code points to the  cell, and the u cell will print it as a string I'll try to come up with a shorter way to fit in strings later. At least it's not Java. # Gogh, 14 bytes "Hello, World!  This one is pretty self-explanatory. Gogh has self-closing strings, so if there isn't a closing double-quote, it tacks one on the end and you have yourself a string. You can run it from the command line like this: $ ./gogh o '"Hello, World!'


# NTFJ, 118 bytes

NTFJ is an esoteric programming language intended to be a Turing tarpit. It is stack-based, and pushes bits to the stack, which can be later coalesced to an 8-bit number. I believe that this is the optimal, using a loop. (Maybe something can be done by hard-coding @ into the string, which would allow for us to double the l. I haven't checked, but I believe this would come out as more bytes.)

Anyhow, this is the full code:

~~#~~~~#~##~~#~~~##~##~~~###~~#~~##~####~#~#~###~~#~~~~~~~#~##~~~##~####~##~##~~~##~##~~~##~~#~#~#~~#~~~@(*~##~#~~~@^)


~~#~~~~#~##~~#~~~##~##~~~###~~#~~##~####~#~#~###~~#~~~~~~~#~##~~~##~####~##~##~~~##~##~~~##~~
#~#~#~~#~~~@(*~##~#~~~@^)


All the ~s push 0 and the #s push 1. The interesting part is the output loop:

@(*~##~#~~~@^)
@              Coalesce to bit (top 8 items); is 0 on an empty stack
(           ) Skip the inside if the top of the stack is not truthy.
*            Output as character.
~##~#~~~@   Push 104 to the stack
^._____________________________________________________/


The interpreter is here, but with no permalinks as of yet.

Boring Loop-less version, 130 bytes:

~#~~#~~~@*~##~~#~#@*~##~##~~@*~##~##~~@*~##~####@*~~#~##~~@*~~#~~~~~@*~#~#~###@*~##~####@*~###~~#~@*~##~##~~@*~##~~#~~@*~~#~~~~#@*


Doubling (:) the l character, 122 bytes:

~#~~#~~~@*~##~~#~#@*~##~##~~@:**~##~####@*~~#~##~~@*~~#~~~~~@*~#~#~###@*~##~####@*~###~~#~@*~##~##~~@*~##~~#~~@*~~#~~~~#@*


## Scratch, 2 blocks

Self explanatory really.

• You're missing a comma in "Hello, World!" Also, I believe the byte count for Scratch submissions is usually done with this: scratchblocks.github.io – a spaghetto Mar 24 '16 at 21:13
• @quartata That means this script takes up 43 bytes. – haykam Jul 20 '16 at 4:06

# Verilog, 60 bytes

module m;initial
begin
$write("Hello, World!");end endmodule  ## JavaScript (Node.js), 28 bytes console.log("Hello, World!")  # Javascript (Nashorn), 22 bytes Nashorn is the JS engine that comes built in to Java. print('Hello, World!')  # .kill();, 39 bytes SFTp^B2lA=ZkWj\9@+*+@9\jWkZ=Al2B^pTGT  Alright, so I made another monster! This is how this works. First, the code is iterated through, and a resulting string is made. First, let's look at the first character and some related information: char: S opposite char: T average char floored: (@S + @T) / 2 = (83 + 84) / 2 = 83.5 => 83 = S index: 0 result: S  Each character in the new string is calculated by averaging the values of the current char and the char that lies the same distance from the end of the string; this value is incremented by the index (starting at zero) then floored. The resulting character is appended to the result. Once this result is made, we look for a valid base64 string in it. This is what that result looks like: SGVsbG8sIFdvcmxkIQ==?UOs#yq'vZ_,Rc!4xky  This will result in the string SGVsbG8sIFdvcmxkIQ== being found as the base 64 string for "Hello, World!", and is thus outputted. (When no such string is found, then a more complicated algorithm ensues that transpiles this to JavaScript, so this is most definitely turing-complete and thus a valid language.) # Pickle, 34 bytes cbuiltins\nprint\n\x8c\rHello, World!\x85R.  Replace the escape sequences by their appropriate character code. Surprise. Python's default serialization implementation actually uses an interpreter over a stack-based language. Just call pickle.load on it to run it. # UGL, 80 bytes cuu$u$$*d*O*u*uO@++uOO^^+O@@$$uu**dO%$$***O@*u*dddO%OuuuO%OdOuO  Try it online! With comments: #H e l l o , W o r l d ! #72 101 108 108 111 44 32 87 111 114 108 100 33 cuuu$$*$d*O #print H 72 (stack:2 3 3 3 3 3 3)$*u$*u$O$@ #print e 101 (stack:101 2 3 3 3 3 101) ++u$O$O #print ll 108 108 (stack:101 2 3 3 108) ^^+$O@@           #print o  111       (stack:108 111 101 2 3 3)
$$uu**dO #print , 44 (stack:108 111 101 2 3) %$$*$**$O@        #print    32        (stack:32 108 111 101 3)
$*$u*dddO         #print W  87        (stack:32 108 111 101)
%\$O               #print o  111       (stack:32 108 101 111)
uuuO              #print r  114       (stack:32 108 101)
%O                #print l  108       (stack:32 101)
dO                #print d  100       (stack:32)
uO                #print !  33        (stack:)

• Which part is the actual 80-byte source code? The non-space prefixes of the lines? Might be best to include that separately for clarity. – Martin Ender Apr 26 '16 at 11:39