Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

"Hello, World!"

+25
−0

Introduction

The classic "Hello, World" challenge. What more can I say?

Rules

  • Program takes no input.
  • Program outputs Hello, World! with an optional trailing newline. No other output is accepted.

Shortest submission in bytes wins.

History
+8
−0

Shakespeare Programming Langua …

6y ago

+8
−0

Vyxal, 2 bytes KH Th …

6y ago

+6
−0

PHP, 13 bytes Hello, Wo …

6y ago

+12
−2

Javascript V8, 888 bytes ```j …

6y ago

+5
−0

HQ9+, 1 byte H Oblig …

6y ago

+5
−0

[Common Lisp], 26 22 bytes …

6y ago

+4
−0

QBASIC, 17, 16 bytes ?" …

5y ago

+4
−0

C# 9, 38 bytes System.C …

5y ago

+4
−0

Perl 5 `-E`, 18 bytes ``` …

5y ago

+4
−0

[Python 2], 20 bytes …

6y ago

+3
−0

[C# (.NET Core)], 60 bytes …

5y ago

+3
−0

05AB1E, 7 bytes ”Ÿ™,‚ï! …

5y ago

+3
−0

LOLCODE, 37 bytes HAI 1 …

6y ago

+3
−0

[C++ (gcc)], 43 bytes …

6y ago

+3
−0

R, 20 bytes ``` cat("Hello …

6y ago

+3
−0

[Bash], 18 bytes ec …

6y ago

+3
−0

SOGL, 10 bytes ╥‰⅜,(ε ‘ū …

6y ago

+2
−0

Stuck, 0 bytes ``` ``` …

1y ago

+2
−0

[Taxi], 183 bytes Go to …

1y ago

+2
−0

Z80 Assembler, 50 bytes ``` …

4y ago

+2
−0

///, 13 bytes ``` Hello, W …

5y ago

+2
−0

[PowerShell], 15 bytes …

5y ago

+2
−0

[RoadLang], 59 bytes …

6y ago

+2
−0

AppleScript, 15 bytes " …

6y ago

+2
−0

[JavaScript (V8)], 28 bytes …

6y ago

+2
−0

[ARBLE], 15 bytes " …

6y ago

+2
−0

Japt, 11 bytes `HÁM, WŽ …

6y ago

+4
−1

Raku, 19 bytes ``` "Hello, W …

6y ago

+1
−0

[Python 3 (PyPy)], 21 bytes …

6d ago

+1
−0

[Emmental], 51 bytes ```non …

1y ago

+1
−0

[C (gcc)], 30 bytes …

2y ago

+1
−0

C (gcc), 46 bytes ```cpp pri …

4y ago

+1
−0

SOS, 155 Bytes !+!-!!+! …

4y ago

+1
−0

J, 15 bytes ``` 'Hello, Wo …

4y ago

+1
−0

[dc], 16 bytes [Hello, …

5y ago

+1
−0

[Seriously], 1 byte H …

5y ago

+1
−0

[Unlambda], 40 bytes `` …

5y ago

+1
−0

[Haskell], 25 bytes …

5y ago

+1
−0

Turing Machine.io, 202 bytes …

5y ago

+1
−0

Scala, 42 bytes object&gt;e …

5y ago

+1
−0

[C# (.NET Core)], 67 bytes …

5y ago

+1
−0

Rockstar, 19 bytes say …

5y ago

+1
−0

PureScript, 25 bytes ``` m …

5y ago

+1
−0

Swift, 23 bytes ```swift p …

5y ago

+1
−0

Kotlin, 34 bytes ```kotlin …

5y ago

+1
−0

[Forth (gforth)], 16 bytes …

5y ago

+1
−0

HTML, 26 13 bytes ``` Hell …

5y ago

+0
−0

[K (oK)], 15 bytes "Hel …

2y ago

+0
−0

[AWK], 2 bytes $0 Tr …

2y ago

+0
−0

JavaScript V8, 26 bytes ``` …

4y ago

+0
−0

[shortC], 16 bytes AJ"H …

5y ago

+0
−0

[jq] `--null-input` `--raw-out …

5y ago

+0
−0

[SQLite], 21 bytes sele …

5y ago

+0
−0

[Emoji], 24 bytes 💬Hell …

5y ago

+0
−0

[Sclipting], (UTF-16) 18 bytes …

5y ago

+0
−0

[Java (JDK)], 80 bytes …

5y ago

+0
−0

[Chef], 558 485 bytes H …

5y ago

+0
−0

[Forget], 319 bytes pus …

5y ago

+0
−0

Lean, 64 bytes ```lean def …

5y ago

+0
−0

[!@#$%^&()+], 17 bytes …

5y ago

+0
−0

[Pyth], 14 bytes "Hello …

5y ago

+0
−0

Bash, 21 Bytes ```bash pri …

5y ago

+0
−0

[Charcoal], 13 bytes He …

5y ago

+0
−0

Java, 37 Bytes ```java v-> …

5y ago

+0
−0

[Lua], 20 bytes pri …

5y ago

1 comment thread

General comments (6 comments)

65 answers

+1
−0

C# (.NET Core), 67 bytes

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

Try it online!

History

0 comment threads

+1
−0

Unlambda, 40 bytes

`````````````.H.e.l.l.o.,. .W.o.r.l.d.!i

Try it online!

History

0 comment threads

+1
−0

dc, 16 bytes

[Hello, World!]p

Try it online!

History

0 comment threads

+1
−0

Kotlin, 34 bytes

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

Try it online!

History

0 comment threads

+1
−0

SOS, 155 Bytes

!+!-!!+!-!!!!+!!-!!+!-!+!-!+!!-!+!!-!!!+!!-!+!!-!!!+!!-!+!!!!-!!+!-!+!!-!!!!+!-!!!!!!+!-!+!-!+!!!-!+!!-!+!!!!-!+!!!-!!+!-!!+!!-!+!!-!!!+!!-!!+!-!!+!-!!!!+!

Explanation:

Each ! outputs a single bit. That bit is 0 if the current stack is empty, and 1 otherwise. Initially the stack is empty. + adds something (an empty stack) to it, and - removes it. As soon as 8 bits are output, the corresponding byte is sent to stdout. Therefore the sequence up to the 8th !, !+!-!!+!-!!! outputs the bit sequence 01001000, which is the ASCII code for the letter H.

The last character uses the fact that if at the end of the program less than 8 bits are output, the value is left-padded with zeros, and the resulting byte is output. So with comments (and spaces to make the output commands line up), the program reads like this:

 !+!-! !+!-! ! !  Output 01001000, i.e. H
 !+! !-! !+!-!+!  Output 01100101, i.e. e
-!+! !-!+! !-! !  Output 01101100, i.e. l
 !+! !-!+! !-! !  Output 01101100, i.e. l
 !+! !-!+! ! ! !  Output 01101111, i.e. o
-! !+!-!+! !-! !  Output 00101101, i.e. comma
 ! !+!-! ! ! ! !  Output 00100000, i.e. space
 !+!-!+!-!+! ! !  Output 01010111, i.e. W
-!+! !-!+! ! ! !  Output 01101111, i.e. o
-!+! ! !-! !+!-!  Output 01110010, i.e. r
 !+! !-!+! !-! !  Output 01101100, i.e. l
 !+! !-! !+!-! !  Output 01100100, i.e. d
    +!-! ! ! !+!  Output 00100001, i.e. exclamation mark
History

0 comment threads

+1
−0

Emmental, 51 bytes

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

Try it online!


Basically what goes on is #[num] pushes the ASCII value of num onto the top of the stack, : duplicates the top of the stack, and . prints the top of the stack.

Admittedly this is probably the most golfed it can get as I seem to be unable to further rearrange everything to get a lower byte count, so it does seem that sub-50 bytes is barely out of reach.

History

0 comment threads

+1
−0

HTML, 26 13 bytes

Hello, World!

Golfed 13 bytes thanks to @Razetime's advice.

History

1 comment thread

general (1 comment)
+1
−0

J, 15 bytes

'Hello, World!'

Or if you prefer to beat around the bush...76 bytes.

{:a.{~-:^:_1@:|.~&2 S:0<@:<\50 16.5 36 50.5 54 54 55.5 22 16 43.5 55.5 57 54

Try it online!

History

0 comment threads

+0
−0

Java (JDK), 80 bytes

class A{public static void main(String[] A){System.out.print("Hello, World!");}}

Try it online!

This answer, except it's actually runnable.

History

0 comment threads

+0
−0

Pyth, 14 bytes

"Hello, World!

Try it online!

History

0 comment threads

+0
−0

Chef, 558 485 bytes

H.

Ingredients.
72 l H
101 l e
108 l l
111 l o
44 l _comma
32 l _space
87 l w
114 l r
100 l d
33 l _bang

Method.
Put _bang into mixing bowl.Put d into mixing bowl.Put l into mixing bowl.Put r into mixing bowl.Put o into mixing bowl.Put w into mixing bowl.Put _space into mixing bowl.Put _comma into mixing bowl.Put o into mixing bowl.Put l into mixing bowl.Put l into mixing bowl.Put e into mixing bowl.Put H into mixing bowl.Pour contents of mixing bowl into baking dish.

Serves 1.

Try it online!

A funny language, indeed. Will need help figuring out how to golf this, because yikes, it's so big.

History

0 comment threads

+0
−0

Bash, 21 Bytes

print "Hello, World!"
History

0 comment threads

+0
−0

JavaScript V8, 26 bytes

console.log`Hello, World!`
History

0 comment threads

+0
−0

Emoji, 24 bytes

💬Hello, World!💬➡

Try it online!

History

0 comment threads

+0
−0

SQLite, 21 bytes

select'Hello, World!'

Try it online!

History

0 comment threads

+0
−0

Charcoal, 13 bytes

Hello, World!

Try it online!

I'm surprised no one even used Charcoal in the challenge. Guess I'll take it.

History

0 comment threads

+0
−0

Forget, 319 bytes

push 72;cleanse;pop;out;push 101;cleanse;pop;out;push 108;cleanse;pop;out;push 108;cleanse;pop;out;push 111;cleanse;pop;out;push 44;cleanse;pop;out;push 32;cleanse;pop;out;push 87;cleanse;pop;out;push 111;cleanse;pop;out;push 114;cleanse;pop;out;push 108;cleanse;pop;out;push 100;cleanse;pop;out;push 33;cleanse;pop;out

Try it online!

Oh, sorry. I forgot.

History

0 comment threads

+0
−0

Lua, 20 bytes

print"Hello, World!"

Try it online!

History

0 comment threads

+0
−0

Lean, 64 bytes

def hello_world:io unit:=put_str"Hello, World!"#eval hello_world

Try it online!

History

0 comment threads

+0
−0

K (oK), 15 bytes

"Hello, World!"

Try it online!

I'm terrible at K, but I've got that one down now.

History

0 comment threads

Sign up to answer this question »