Create the shortest possible obfuscated program that displays the text "Hello World".

In order to be considered an obfuscated program, it must meet at least two of the following requirements:

  • Does not contain the characters: h, l, w and d in any case
  • Does not contain the characters: e, o, r, 0, and 1 in any case
  • Does not contain the characters: 2 or 7


Hello World

  • 6
    \$\begingroup\$ I guess import in python is not permitted. \$\endgroup\$ – Alexandru Feb 1 '11 at 0:07
  • 26
    \$\begingroup\$ Does these rules apply to language keywords as well? \$\endgroup\$ – hallvabo Feb 1 '11 at 13:04
  • 8
    \$\begingroup\$ are those case insensitive restrictions? \$\endgroup\$ – oenone Aug 4 '11 at 14:22
  • 19
    \$\begingroup\$ Could someone explain why 2 and 7 are not allowed? I'm just curious as I don't see why those were chosen in particular. \$\endgroup\$ – Thomas Eding Aug 5 '11 at 23:01
  • 4
    \$\begingroup\$ @trinithis, and others, ASCII character 72 is "H" which is why I chose those two \$\endgroup\$ – Kevin Brown Sep 18 '11 at 23:18

119 Answers 119


C (79*12=948)

Using no strings or characters, and only the number one.
I was a little creative with the bitshifts and subtractions to make them fit onto at 80x12 console. Ask me in the comments if you can't figure it out.

int i[(1+1)+1],*I=i;main(){*I++=(((1<<((1<<(1+1))*(1<<(1+1))))+((1<<((((1<<(1<<

Befunge-93 - 57 characters


Should meet all three requirements.



my @txt = (

$\ = "\n";
print map{pack 'C', 330/3 + $_} @txt;

I would have been able to do it without any of the of the "forbidden" characters, except there is no easy way, that I can think of to enable the use of anything other than print or die, without using, at least one of the "forbidden" characters.

use feature 'say' # e
use 5.010; # 10
BEGIN{ $^H{'feature_say'} = !'' } # eh
use Modern::Perl # ero

say ...
use IO::Handle; # e
STDOUT->say( ... )

So the only way is to load a module, that internally loads IO::Handle. Which will indirectly enable the use of STDOUT->say.


C, ??? characters

Not very heavily golfed, but I was going more for obfuscation anyway. Your mileage may vary, you'll probably have to do some crap to get the hardcoded address of printf right. No forbidden characters. You could easily shorten up a lot of stuff by not using different numbers of underscores as variable names and instead using 1 letter things, but I think it looks uglier this way.

int main()
    int _=9-8,__=_<<_,___=__<<_,____=___<<_,_____=____<<_,______=_____<<_,$=_|((_____|____)<<__);

    f("%c", $+(_|__|___)^______);
    f("%c", $+(___));
    f("%c", $+(_|__|____));
    f("%c", $+(_|__|____));
    f("%c", $+(__|___|____));
    f("%c", ______);
    f("%c", $+(__|___|_____)^______);
    f("%c", $+(__|___|____));
    f("%c", $+(_|_____));
    f("%c", $+(_|__|____));
    f("%c", $+(_|__));
    f("%c", ______|_);

Befunge-93, 8x6 grid

I know I'm a little late to the party, but I saw the Befunge-93 solutions and decided to see how small I could make one while still following all the rules.


><> (Fish), 80 bytes

Wait, I'm not the only one that uses ><>?


Thanks to @Sp3000 for a method to print without "o".

Try it here.


C (333 characters)

I decided to emphasize on obfuscate, with golf secondary. This is written entirely in C, and it only breaks rule #2 laid out in the original post. It also breaks I don't know how many C programming rules...

int main(){
int a[]={0x0a004000,0x0fc00109,0x04e01500,0x09e08400,0x03506a61,0x00f00000,0x0f010ae3,0x05f0fb16,0x0beb0030,0x0130a300,0x0bc00500,0x00000000};
int b,c=13,e,x,an;
goto _XX;
_10:if(!an)goto _XX;
goto _10;
_XX:if(c<=1)goto _40;
goto _00;
_40:return 0;

J (23 characters)


It doesn't beat Golfscript, but I figure J deserves an entry anyway. (This is just a minor tweak of the second example on the J vocabulary page for the word i..


C Program (83 Characters)

void main(){printf("%ce%c%co %cor%c%c",104,108,108,119,108,100);}
  • 1
    \$\begingroup\$ This program satisfies rules 1 and 3. \$\endgroup\$ – Aniket Suryavanshi May 1 '12 at 17:46


329 bytes including newlines and extraneous backslashes on newlines (which are 7 bytes).

C++ is in scare quotes because of all the implementation dependent details (gcc, appropriate linux kernel, x86). Doing this challenge in C++ is difficult because right off the bat #include is forbidden.

int main(){int r[]={1819043144,1866980911+1000000,164353511+10000011};asm("sub \
$31,%%esp\nsub $1,%%esp\nmov $4,%%eax\nmov %%eax,0x1C(%%esp)\nmov %0,%%eax\nmov\
 %%eax,0x18(%%esp)\nmov %1,%%eax\nmov %%eax,0x14(%%esp)\nmov $1,%%eax\nmov %%ea\
x,16(%%esp)\npopa\nint $0x80"::"r"(r),"r"(9+3):"%eax","%ebx","%ecx","%esi",

I think there's technically a bit of undefined behavior here as well, since I don't tell gcc all the registers I clobber (Things like %edx cannot be referred to directly) which is unfortunate.


JavaScript 155 142 122

This satisfies ALL the rules provided.

"t('\x48\x65\x6c\x6c\x6f \\x5"+-~6+"\x6f'+_+'\x6c\x64')")()
  • 1
    \$\begingroup\$ You can do -~[] to get 1. Also, using my approach with constructor twice instead of going via []["sort"] saves you even more: 3[$="c\x6fnst"+(_=(!+[]+"")[-~[]])+"uct\x6f"+_][$] gets you Function and saves 14 chars. \$\endgroup\$ – FireFly Jan 20 '14 at 23:08
  • \$\begingroup\$ @FireFly, nice spotting... All rules now done in 142 characters... I had to account for the "W"... Damn hard character to get with the restrictions... \$\endgroup\$ – WallyWest Jan 21 '14 at 0:54
  • 1
    \$\begingroup\$ I took the liberty to edit the post with some more changes, I hope you don't mind... get boolean true via !!4, the number 1 via 5-4, and by making use of double-escaping (once because of the string literal, and then a second time due to the string literal inside the alert in the function body) we could simply concatenate the -~6 into the string instead of having to unescape. \$\endgroup\$ – FireFly Jan 21 '14 at 12:31
  • \$\begingroup\$ @FireFly As Humphrey Bogart said in Casablanca "This looks like the start of a beautiful friendship." :) But I have to ask, what the hell is the use of the 3? I see ',3[C="' but don't understand the number's importance in the code? \$\endgroup\$ – WallyWest Jan 21 '14 at 22:15
  • 1
    \$\begingroup\$ Haha. The 3 replaces [] in your code because both numbers and arrays (like all other types constructed via constructor functions) inherit a 'constructor' property from their prototype. It doesn't matter which of these that we use, so I switched to 3 since it saves a character. In the end, it's just a stepping stone to reach Function (as the constructor of the Number function, i.e. Number.constructor). If you want to discuss further we should probably use the chatroom instead... \$\endgroup\$ – FireFly Jan 21 '14 at 22:33

Sclipting, 8 characters


Of course, this doesn’t contain any of the restricted characters.

(This answer is technically cheating because Sclipting was invented after this challenge was posted.)


Haskell (genetic programming), 306 chars

This is not really genetic programming. It's just a pun. The only violation of the rules is the function name putStrLn, which is a builtin I/O function, and follows the spirit of the rules even if it doesn't quite match the letter.

y= \x->x-x
  • \$\begingroup\$ +1. But what's the significance of the parens around y on line 4? \$\endgroup\$ – YoYoYonnY Jan 30 '16 at 0:15
  • 1
    \$\begingroup\$ None whatsoever. I suppose you could shave off a couple extra chars, but this isnt a competitive answer in any case. \$\endgroup\$ – archaephyrryx Jan 30 '16 at 4:58

Golfscript 18 bytes

New code (saved 4 bytes thanks to Martin Büttner):


Old code (22 bytes):

"Jgnnq\"Yqtnf"{1 1+-}%

It basically preforms a Caesar cipher two times. Because you can't have a 2 in your code, I just used 1+1. It doesn't break any of the rules.

  • \$\begingroup\$ (( (decrement twice) is shorter than 1 1+-. Also, does GolfScript support ' to delimit strings? In that case you wouldn't need to escape the " in the string. \$\endgroup\$ – Martin Ender Mar 9 '15 at 12:47

Clip, 17 chars

All rules followed.


This just means, in a more readable form, map (add 2 to ascii value) "Fcjjm▲Umpjb".


Pyth - 24 bytes. All 3 rules

Noticed there wasn't a Pyth entry yet (probably because the question's been around longer), but wanted to add one for completion's sake!


Try it out.


# basically just a -9 int value translation on each character

V"Qnuux)`x{um"        ;     # for each chr (N) in the string "Qnuux)`x{um"
              =+k           #   append to k (initially an empty string)
                 C          #   the character value of the integer
                  -  9      #   that results from subtracting 9 from
                   CN       #   the integer value of the current chr (N)
                       k    # print k

C 61 Bytes

main(){printf("%ce%c%co %cor%c%c",9*8,108,108,86+1,108,100);}

Went as small as possible on this guy. Hopefully y'all can see that. This breaks rule 2.

  • \$\begingroup\$ The rules say you have to comply with two of the three rules. I follow rule 1 and 3 \$\endgroup\$ – bioweasel Oct 20 '16 at 19:47

Befunge-93, 49 45 bytes

Thanks to James Holderness for saving me two four bytes! (I don't know how to count)

Why is this 7-year-old challenge in the front page? I don't know! What I do know is that I came up with an answer before I realized the thread is ancient, so here goes:


Works in complete disregard to the third rule, but that's fine because rules are made to be broken anyway it meets 1 and 2.

Try it online!


Java, 88

I'm surprised, nobody used java.

System.out.print\u006Cn("\u0048e\u006C\u006Co "+((c\u0068ar)(11*8-1))+"or\u006C\u0064");
  • \$\begingroup\$ 1) this is not a complete function; 2) byte count is wrong. See my answer. \$\endgroup\$ – Andrey Jan 18 '17 at 8:04
  • \$\begingroup\$ @Andrey 1) it won't compile, but you can run it in jshell under java 9, as for 2 i fixed it. \$\endgroup\$ – user902383 Jan 18 '17 at 8:17

pb, 72 bytes


Violates rule II

  • \$\begingroup\$ oh hey, someone else wrote a pb answer! (i'm a little late) \$\endgroup\$ – undergroundmonorail Sep 8 '17 at 6:13
  • \$\begingroup\$ @undergroundmonorail hey you're back! (?) \$\endgroup\$ – Erik the Outgolfer Sep 8 '17 at 9:16
  • \$\begingroup\$ i check this site every day... has it really been that long since i posted anything? o_o \$\endgroup\$ – undergroundmonorail Sep 9 '17 at 5:55

C, 2066 bytes

NOTE: Little-endian only. (That should give readers a hint at what this strange code does.)

Certainly not going to win, but it's kinda neat anyway (IMO). Satisfies first and third requirements.

int _(){return 0;}int __(_){return(1+_);}int _____(_
,__){return(_+__);}int ______(_,___){return(_*___);}
int ___(_,__){return _<<__;}int main(){int ____[4]={
  • 1
    \$\begingroup\$ Yes, but the original problem statement stipulated that answers "...must meet at least two of the following [3] requirements." Mine does this. \$\endgroup\$ – pr1268 Jan 27 '17 at 18:18
  • 1
    \$\begingroup\$ @pr1286 Sorry, my bad, goes to show everyone is capable of misreading questions. Anyway the welcoming to the site still stands. \$\endgroup\$ – 0 ' Jan 27 '17 at 22:45
  • 2
    \$\begingroup\$ Oh my, CFuck? I didn't know such a thing existed. \$\endgroup\$ – lol Mar 31 '17 at 8:05

17, 80 bytes

It isn't much bigger than the normal hello world for 17 due to it using base 17. I have to break rule 3 since the "main" function for 17 is 777, so all 17 programs must contain 7, so I am following the other 2.

777{44 $ 5g $ 66 : : $ $ 69 : $
22 4 - $ 52 $ $ 6c $ $ 5f $ 22 3 - $ a $ - @}
  • \$\begingroup\$ Welcome to PPCG! Nice first post! Is that your language as well? \$\endgroup\$ – Riker Feb 4 '18 at 18:33
  • \$\begingroup\$ Thanks, yes, I made 17, though not for this challenge \$\endgroup\$ – Hugh Williams Feb 4 '18 at 18:42

FSharp, 83

("(())(((()("|>String.mapi(fun i c->" =CCG/GJC<".[i]+c)).Insert(5," ")|>printf "%s"

Breaks the second rule to use some F# keywords.


Groovy - 50 93 96 Characters


Breaks rule 2. I don't see any other option than breaking rule 2, as AFAIK it's necessary to use either System.out or println, and using println will break both rules 1 and 2.


s={k,v->for(;v>0;v>>=6)System.out<<(k-(v&63) as byte[])}
s 113,34886441
s 48,16
s 130,509150443

Second attempt: much longer, more obfuscated, and hopefully passes all the rules!

Rule Check:

    it in ("""s={k,v->for(;v>0;v>>=6)System.out<<(k-(v&63) as byte[])}
    s 113,34886441
    s 48,16
    s 130,509150443""" as List)
  • \$\begingroup\$ Also breaks rule 1, because "char" contains an "h". \$\endgroup\$ – Luigi Plinge Nov 20 '11 at 15:54
  • \$\begingroup\$ ouch, will take a look \$\endgroup\$ – Armand Nov 20 '11 at 18:15
  • \$\begingroup\$ each breaks rules 1 and 2 ... but they are pretty stupid rules, IMO \$\endgroup\$ – Luigi Plinge Nov 21 '11 at 17:53
  • \$\begingroup\$ @Luigi good point - have removed each, and corrected the rule check so it actually works \$\endgroup\$ – Armand Nov 22 '11 at 6:43

BrainFuck (96 char)

Beside @R. Martinho Fernandes's BrainFuck answer, this is another BF program with 10 less characters

  • 1
    \$\begingroup\$ I say this fails, it outputs "hello world" not "Hello World". \$\endgroup\$ – user3710044 Mar 5 '15 at 8:48

Q (40 chars)

Silly answer but it satisfies rule 1 & 2


APL (157 155)

No h, l, r, w, d, 2, 7, e, o, or r, but there is 0 and 1 (so it meets two out of three requirements).

I went for obfuscation rather than size. (If you can't figure out how it works, it is a variation of this guy's method).

⎕UCS{⌈+/96,⍵{⊃a×b○c×1.118×⍺,a b c←⍵}¨,⌿((11-33)13.3 ¯8.5 18(.3×4)16.5 4 8.5 .4 6,[0]10⍴(⍴'⍴⍴')1),[1]⌈.5×⍳10}¨(⍳11)-1

APL (28)

Boring straightforward one, but meets all requirements and is short-ish.

  • \$\begingroup\$ +1 That's a great link. But your code's greek to me. :) (Don't worry, I'll get there. Just got some Iverson from Amazon.) \$\endgroup\$ – luser droog Apr 10 '13 at 3:58
  • \$\begingroup\$ Save a byte on the bottom one with -⍴⍬⍬ \$\endgroup\$ – Adám Jul 20 '16 at 15:55

Processing, 189 characters

int[]z={104,101,108,108,111,119,111,114,108,100};for(int i=0;i<z.length;i++)if(i==0||i==5)print((char)Character.toUpperCase(z[i]));else if(i==4)print((char)z[i]+" ");else print((char)z[i]);

If I'm not mistaken, this program only violates rule number two... unless of course the 'h' in "Character" is ruled as a violation. First post to CodeGolf!


int[] z = {104, 101, 108, 108, 111, 119, 111, 114, 108, 100};

for (int i = 0; i < z.length; i++)
    if (i == 0 || i == 5) print((char) Character.toUpperCase(z[i]));
    else if (i == 4) print((char) z[i] + " ");
    else print((char) z[i]);
  • 1
    \$\begingroup\$ Yes, h is a violation. \$\endgroup\$ – pts Aug 24 '13 at 6:59
int main()
{printf("%c%c%c%c%c%c%c%c%c%c%c", ('C'+5), ('a'+4), ('i'+3), ('f'+6), ('i'+6), (35-3), ('T'+3), ('j'+5), ('k'+7), ('g'+5), ('f'-2));}

Javascript 54

(Violates only rule 3)

c="c\x6fnst\x72uct\x6f\x72",f=""[c][c],f("a\x6c\x65\x72t(\"\x48\x65\x6c\x6c\x6f \x57\x6f\x72\x6c\x64\")")()

Test if any character of rule 1,2 contained

/[hlwdeor01]/ig.test('c="c\\x6fnst\\x72uct\\x6f\\x72",f=""[c][c],f("a\\x6c\\x65\\x72t(\\"\\x48\\x65\\x6c\\x6c\\x6f \\x57\\x6f\\x72\\x6c\\x64\\")")()') // false


protected by Community Dec 9 '18 at 22:11

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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