Your goal is to print (to the standard output) the largest number possible, using just ten characters of code.

  • You may use any features of your language, except built-in exponentiation functions.
    • Similarly, you may not use scientific notation to enter a number. (Thus, no 9e+99.)
  • The program must print the number without any input from the user. Similarly, no reading from other files, or from the Web, and so on.
  • Your program must calculate a single number and print it. You can not print a string, nor can you print the same digit thousands of times.
  • You may exclude from the 10-character limit any code necessary to print anything. For example, in Python 2 which uses the print x syntax, you can use up to 16 characters for your program.
  • The program must actually succeed in the output. If it takes longer than an hour to run on the fastest computer in the world, it's invalid.
  • The output may be in any format (so you can print 999, 5e+100, etc.)
  • Infinity is an abstract concept, not a number. So it's not a valid output.
  • 4
    \$\begingroup\$ Did you look at these two? codegolf.stackexchange.com/questions/185/… codegolf.stackexchange.com/questions/18028/… \$\endgroup\$ – MadTux Jun 13 '14 at 13:35
  • 21
    \$\begingroup\$ What do you exactly mean by "calculate". Also, If it takes longer than an hour to run on any computer in the world, it's invalid. is not objective. I could (theoretically) manufacture a computer that takes an hour to change one T-state \$\endgroup\$ – user80551 Jun 13 '14 at 13:37
  • 4
    \$\begingroup\$ Does bit-shift count as an exponentiation operator since it is equivalent to * 2^x ? \$\endgroup\$ – Claudiu Jun 13 '14 at 16:08
  • 14
    \$\begingroup\$ The fact that the time limit depends on the performance of the fastest computer in the world makes it impossible for us to determine the set of valid answers... I don't really like that \$\endgroup\$ – David Z Jun 13 '14 at 19:45
  • 6
    \$\begingroup\$ Exponentiation functions are not allowed, but ackermann function is allowed? That seems really arbitrary. It remains unclear why a symbolic manipulation is considered "calculating" the number. \$\endgroup\$ – Reinstate Monica Jul 7 '15 at 13:12

69 Answers 69


Wolfram Language


ack(9!,9!) = enter image description here

Output is in Arrow Notation.

  • 3
    \$\begingroup\$ @KyleKanos Its different because the code/program isn't calling out to the web. Other Examples typescriptlang.org/Playground tryfsharp.org/Learn/getting-started \$\endgroup\$ – Adam Speight Jun 15 '14 at 1:52
  • 35
    \$\begingroup\$ The Wolfram Language is available to use an Raspberry Pi and doesn't require web access. So isn't in violation of that rule. \$\endgroup\$ – Adam Speight Jun 15 '14 at 2:15
  • 6
    \$\begingroup\$ I think it is very valid answer. Stupid reasoning for being on island and having no access to internet. 'No web' requirement is only to prevent printing output from a already available resource. All answers are valid as long as they 'run' a piece of code to calculate the output. Latest Visual Studio is coming that runs your code on the Azure cloud, so you want to restrict C#? Or you are ineligible if you have chromebook? \$\endgroup\$ – microbian Jun 19 '14 at 17:08
  • 26
    \$\begingroup\$ ack(99!,9) is much, much larger. \$\endgroup\$ – jimmy23013 Mar 13 '15 at 2:21
  • 11
    \$\begingroup\$ One of the other answers says that ack(4,2) is the largest he can calculate in an hour so I would be surprised if this did... \$\endgroup\$ – Jerry Jeremiah Jul 7 '15 at 12:32

Perl, >1.96835797883262e+18


Might not be the largest answer... today! But wait enough millennia and it will be!


To address some of the comments, by "enough millenia," I do in fact mean n100s of years.

To be fair, if the big freeze/heat death of the universe is how the universe will end (estimated to occur ~10100 years), the "final" value would be ~10214, which is certainly much less than some of the other responses (though, "random quantum fluctuations or quantum tunneling can produce another Big Bang in 101056 years"). If we take a more optimistic approach (e.g. a cyclic or multiverse model), then time will go on infinitely, and so some day in some universe, on some high-bit architecture, the answer would exceed some of the others.

On the other hand, as pointed out, time is indeed limited by the size of integer/long, so in reality something like ~0 would always produce a larger number than time (i.e. the max time supported by the architecture).

This wasn't the most serious answer, but I hope you guys enjoyed it!

  • 23
    \$\begingroup\$ Upvoted because I like the eventuality \$\endgroup\$ – Tim Jun 13 '14 at 18:40
  • 5
    \$\begingroup\$ Won't time wrap around and return a small number at some point? Depends on whether it's 32-bit or 64-bit perl I guess \$\endgroup\$ – Claudiu Jun 13 '14 at 20:48
  • 3
    \$\begingroup\$ 1000 years ~ 3e10 seconds, so you'll still be hovering around 1e21 as your output. Perhaps if you waited 1e50 years, you might start competing against the other answers? \$\endgroup\$ – Kyle Kanos Jun 14 '14 at 2:19
  • 8
    \$\begingroup\$ Do you pronounce this "time times time"? :-) (hi Timwi!) \$\endgroup\$ – Pierre Arlaud Jun 16 '14 at 14:01
  • 1
    \$\begingroup\$ Is the time on death heat of the universe accounting for daylight savings? You could earn a few more seconds of existence. \$\endgroup\$ – Alpha Jun 17 '14 at 17:35

Wolfram ≅ 2.003529930 × 1019728

Yes, it's a language! It drives the back-end of the popular Wolfram Alpha site. It's the only language I found where the Ackermann function is built-in and abbreviated to less than 6 characters.

In eight characters:

$ ack(4,2)


Or ≅ 2.003529930 × 1019728

ack(4,3), ack(5,2) etc. are much larger, but too large. ack(4,2) is probably the largest Ackermann number than can be completely calculated in under an hour.

Larger numbers are rendered in symbolic form, e.g.:

$ ack(4,3)

2↑²6 - 3 // using Knuth's up-arrow notation

The rules say any output format is allowed, so this might be valid. This is greater than 101019727, which is larger than any of the other entries here except for the repeated factorial.


$ ack(9,9)

2↑⁷12 - 3

is larger than the repeated factorial. The largest number I can get in ten characters is:

$ ack(99,99)

2↑⁹⁷102 - 3

This is insanely huge, the Universe isn't big enough to represent a significant portion of its digits, even if you took repeated logs of the number.

  • 85
    \$\begingroup\$ Not bad, but it's no match for my ack(4,2)+1 solution. \$\endgroup\$ – user19057 Jun 13 '14 at 21:58
  • 13
    \$\begingroup\$ ack(4,2)+2, I WIN \$\endgroup\$ – user18660 Jun 13 '14 at 22:07
  • 1
    \$\begingroup\$ I think you won. \$\endgroup\$ – Anonymous Pi Jun 15 '14 at 17:34
  • 20
    \$\begingroup\$ @Kyle, Yimin There are lots of misleading statements in this post and the comments under it. This is not the Wolfram Language, and not what's used as the backend of W|A. It is simply "natural language" input to Wolfram|Alpha. In the Wolfram Language ack(4,2) is invalid input. W|A's natural language input shouldn't even count as a programming language. It is not Turing complete, and you can't write even basic programs in it such as Euclid's algorithm. For this reason I don't think this is a valid answer any more than a Google query would be. \$\endgroup\$ – Szabolcs Jun 16 '14 at 13:48
  • 4
    \$\begingroup\$ The Wolfram Language is the programming language used in Mathematica, documented here. Wolfram|Alpha takes natural language as input, not the Wolfram Language. \$\endgroup\$ – Szabolcs Jun 16 '14 at 13:49

Python2 shell, 3,010,301 digits


Calculating the length: Python will append a "L" to these long numbers, so it reports 1 character more than the result has digits.

>>> len(repr( 9<<9999999 ))

First and last 20 digits:

40724177878623601356... ...96980669011241992192
  • 2
    \$\begingroup\$ Darn it! This showed up whilst I was writing the same answer \$\endgroup\$ – James_pic Jun 13 '14 at 15:05
  • 2
    \$\begingroup\$ That's really just 9 * 2**9999999, so one could argue it uses exponentiation. \$\endgroup\$ – Dennis Jun 13 '14 at 15:29
  • 2
    \$\begingroup\$ Wait, ***built-in*** exponentiation functions are not allowed so this might slip under the rules. +1 \$\endgroup\$ – user80551 Jun 13 '14 at 15:53
  • 1
    \$\begingroup\$ Mathematical way of computing the length: floor(log10(9 * 2**9999999))+1 \$\endgroup\$ – Justin Jun 13 '14 at 18:09
  • 8
    \$\begingroup\$ 9<<(9<<99) is a lot bigger, if it terminates. \$\endgroup\$ – Keith Randall Jun 14 '14 at 23:16

CJam, 2 × 10268,435,457


This computes b, defined as follows:

  • a0 = 10

  • an = an - 12

  • b = 20 × a28

$ time cjam <(echo 'A28{_*}*K*') | wc -c
Real    2573.28
User    2638.07
Sys     9.46


This follows the same idea as Claudiu's answer, but it isn't based on it. I had a similar idea which I posted just a few minutes after he posted his, but I discarded it since it didn't come anywhere near the time limit.

However, aditsu's suggestion to upgrade to Java 8 and my idea of using powers of 10 allowed CJam to calculate numbers beyond the reach of GolfScript, which seems to be due to some bugs/limitations of Ruby's Bignum.

How it works

A    " Push 10.                                                          ";
28{  " Do the following 28 times:                                        ";
  _* " Duplicate the integer on the stack and multiply it with its copy. ";
}*   "                                                                   ";
K*   " Multiply the result by 20.                                        ";

CJam, ≈ 8.1 × 101,826,751


Takes less than five minutes on my machine, so there's still room for improvement.

This computes a20, defined as follows:

  • a0 = 20

  • an = (n × an - 1)2

How it works

KK,   " Push 20 [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ]. ";
{     " For each integer in the array:                                 ";
  )*  " Increment it and compute the its product with the accumulator. ";
  _*  " Multiply the result with itself.                               ";
  • 21
    \$\begingroup\$ Haha, is that Kirby? :) \$\endgroup\$ – aditsu quit because SE is EVIL Jun 13 '14 at 15:28
  • \$\begingroup\$ Could you describe what this is doing? \$\endgroup\$ – Kyle Kanos Jun 13 '14 at 17:59
  • 2
    \$\begingroup\$ FYI, I ran some tests to check BigInteger performance - I calculated 100000! and converted to string. Results: java 6: 21 sec calculation, 44 sec toString; java 7: 14 sec calculation, 42 sec toString; java 8: 5 sec calculation, 1 sec toString! \$\endgroup\$ – aditsu quit because SE is EVIL Jun 13 '14 at 20:27
  • 1
    \$\begingroup\$ @aditsu: Upgrading Java reduced the runtime from 5 minutes to 2 seconds! \$\endgroup\$ – Dennis Jun 13 '14 at 21:53

Python 3, 9*2^(7*2^33) > 10^18,100,795,813

9*2^(2^35) > 10^10,343,311,894

Edit: My new answer is:


Old answer, for posterity:


Ten characters exactly.

I am printing the number in hex, and

You may exclude from the 10-character limit any code necessary to print anything. For example, in Python 2 which uses the print x syntax, you can use up to 16 characters for your program.

Therefore, my actual code is:


Proof that it runs in the specified time and generates a number of the specified size:

time python bignum.py > bignumoutput.py

real    10m6.606s
user    1m19.183s
sys    0m59.171s
wc -c bignumoutput.py 
15032385541 bignumoutput.py

My number > 10^(15032385538*log(16)) > 10^18100795813

3 less hex digits than the above wc printout because of the initial 0x9.

Python 3 is necessary because in python 2, 7<<33 would be a long, and << doesn't take longs as inputs.

I can't use 9<<(1<<36) instead because:

Traceback (most recent call last):
  File "bignum.py", line 1, in <module>

Thus, this is the largest possible number of the form a<<(b<<cd) printable on my computer.

In all likelihood, the fastest machine in the world has more memory than I do, so my alternate answer is:


9*2^(9*2^99) > 10^(1.7172038461*10^30)

However, my current answer is the largest anyone has submitted, so it's probably good enough. Also, this is all assuming bit-shifting is allowable. It appears to be, from the other answers using it.

  • \$\begingroup\$ So far this looks to be the largest answer by far. It's a 10,000,000,000 digit number, after all. \$\endgroup\$ – nneonneo Jun 14 '14 at 15:09
  • 1
    \$\begingroup\$ @nneonneo : I believe my solution is larger :) \$\endgroup\$ – Zaid Jun 15 '14 at 11:37
  • \$\begingroup\$ Your alternate answer requires juuuuust less than 1 MiYiB of memory, and requires 100 bits of addressable memory (so it won't work until at least 128-bit Python). (Source: my similar answer) \$\endgroup\$ – wizzwizz4 Feb 8 '17 at 20:22

Any language with short enough constant names, 18 digits approx.


I would post this as a PHP answer but sadly M_PI makes this just a little too long! But PHP yields 8.0839634798317E+17 for this. Basically, it abuses the lack of absolute precision in PI :p

  • 1
    \$\begingroup\$ Can't you do tan(PI/2)? \$\endgroup\$ – user80551 Jun 13 '14 at 15:56
  • 1
    \$\begingroup\$ @user80551 Could do, but I just noticed that I could make use of that last remaining character in the limit to boost my result by 99 times. \$\endgroup\$ – Niet the Dark Absol Jun 13 '14 at 15:58
  • \$\begingroup\$ Too long in Common Lisp: (/ 99(sin pi)) (14 characters). Error in TI-83: 99/sin(π (8 characters) causes division by zero. Works in LibreOffice Calc: =99/SIN(PI( (10 characters, not counting =) computes 808423047055000000. LibreOffice auto-inserts the last two )) in =99/SIN(PI()). \$\endgroup\$ – kernigh Jun 13 '14 at 20:12
  • \$\begingroup\$ It's depending on the precision of the language. In PHP 14 decimal digits is a common value. \$\endgroup\$ – kenorb Jun 14 '14 at 9:42
  • \$\begingroup\$ @kernigh It doesn't matter in this case, but would 99/sin(π be five bytes or eight? I know TI-BASIC stores a bunch of commands as single bytes; is sin( one of them? \$\endgroup\$ – wchargin Jun 15 '14 at 0:33


Without any tricks:

main = print -- Necessary to print anything
    $9999*9999 -- 999890001

Arguably without calculating anything:

main = print
    $floor$1/0 -- 179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216

Adapting Niet's answer:

main = print
    $99/sin pi -- 8.083963479831708e17
  • \$\begingroup\$ Third bullet says "Your program must calculate..." \$\endgroup\$ – user80551 Jun 13 '14 at 19:51
  • 8
    \$\begingroup\$ floor(infinity) is a finite number? What the heck Haskell? \$\endgroup\$ – nneonneo Jun 14 '14 at 15:23
  • 3
    \$\begingroup\$ 1/0 != infinity, it's undefined. \$\endgroup\$ – RubberDuck Jun 15 '14 at 17:39
  • 1
    \$\begingroup\$ Are you sure about that, @ckuhn203? In both GHC 7.6.3 and 7.8.2, I get isInfinite $ 1 / 0 -- True. As far as I can tell, IEEE 754 defines 1 / 0 as infinity. \$\endgroup\$ – Taylor Fausak Jun 16 '14 at 14:30
  • 2
    \$\begingroup\$ Oh, you mean mathematically. I agree completely. But as far as programming with IEEE floating point (and Haskell in particular) is concerned, 1 / 0 == Infinity. \$\endgroup\$ – Taylor Fausak Jun 16 '14 at 18:06

Powershell - 1.12947668480335E+42


Multiplies 99 Pebibytes times 9,000,000,000 Pebibytes.

  • 7
    \$\begingroup\$ 98901 sq petabytes? Is that some sort of method to measure the surface bit density of (future high-capacity)hard-disks? \$\endgroup\$ – user80551 Jun 14 '14 at 13:33
  • \$\begingroup\$ Oh, nice. Didn't know pebibytes were possible by now. I always thought it stopped at tebibytes. \$\endgroup\$ – Joey Jun 17 '14 at 17:40
  • \$\begingroup\$ @Joey Now if MS would only hurry up and add yobibytes, the answer could be even better. \$\endgroup\$ – Rynant Jun 17 '14 at 18:26
  • 1
    \$\begingroup\$ I could add that to Pash if it helps ... ;-) \$\endgroup\$ – Joey Jun 17 '14 at 21:45
  • \$\begingroup\$ 1+"1"*309 outputs 1.1111e308 though I suppose this breaks the spirit, if not the word of the rule on printing characters. It's cast to a double for output. \$\endgroup\$ – tomkandy Jan 20 '16 at 15:01

J (((((((((9)!)!)!)!)!)!)!)!)

Yeah, that's a lot. 10^(10^(10^(10^(10^(10^(10^(10^6.269498812196425))))))) to be not very exact.

  • 5
    \$\begingroup\$ I did find a compiler, but after 20 minutes, !!9x hasn't printed anything to screen. I sincerely doubt that !!!!!!!!9x will ever be computed. \$\endgroup\$ – Kyle Kanos Jun 13 '14 at 15:47
  • 16
    \$\begingroup\$ "If it takes longer than an hour to run on the fastest computer in the world, it's invalid." Not sure this would be valid since it doesn't run within an hour \$\endgroup\$ – Claudiu Jun 13 '14 at 15:52
  • 11
    \$\begingroup\$ It took 70 minutes, but !!9x finally printed to screen. I'm impressed that it actually computed the value, but it still completely fails bullet 5. \$\endgroup\$ – Kyle Kanos Jun 13 '14 at 17:04
  • 6
    \$\begingroup\$ @Quincunx: Likely true, however the condition for a valid answer is that the program must succeed in output; this answer completely fails that criterion. Sadly, the upvoters have neglected all the comments pointing this out and still upvote it over the CJam & Golfscript answers that are insanely huge and compute in reasonable time. \$\endgroup\$ – Kyle Kanos Jun 13 '14 at 18:01
  • 3
    \$\begingroup\$ Downvoted because it doesn't print out the answer. \$\endgroup\$ – isaacg Jun 15 '14 at 7:38

K/Kona: 8.977649e261 1.774896e308

  • !170 creates a vector of numbers from 0 to 169
  • 1.6+ adds one to each element of the vector & converts to reals (range is 1.6 to 170.6)
  • */ multiplies each element of the array together

If Kona supported quad precision, I could do */9.+!999 and get around 1e2584. Sadly, it doesn't and I'm capped to double precision.

old method

  • !99 creates a vector of numbers from 0 to 98
  • 9+ adds 9 to each element of the vector (now ranges 9 to 107)
  • 9.* multiplies each element by 9.0 (implicitly converting to reals, so 81.0 through 963.0)
  • */ multiplies each element of the vector together

HTML, 9999999999


.. nailed it.

  • 1
    \$\begingroup\$ not a programming language, though. \$\endgroup\$ – cat May 7 '16 at 13:18
  • 1
    \$\begingroup\$ Use PHP, it's better! \$\endgroup\$ – CalculatorFeline May 7 '16 at 19:19
  • \$\begingroup\$ @cat In this case, it's fine, as this is reminiscent of kolmogorov complexity challenges. \$\endgroup\$ – Addison Crump Feb 7 '17 at 1:36
  • \$\begingroup\$ 9&Hat;9999 prints 9^9999. Just sayin :) \$\endgroup\$ – Jan Feb 8 '17 at 20:06
  • 1
    \$\begingroup\$ saddly PHP_INT_MAX is 11 \$\endgroup\$ – ArtisticPhoenix Feb 12 '18 at 20:56

Python - Varies, up to 13916486568675240 (so far)

Not entirely serious but I thought it would be kinda fun.

print id(len)*99

Out of all the things I tried, len was most consistently getting me large ids.

Yielded 13916486568675240 (17 digits) on my computer and 13842722750490216 (also 17 digits) on this site. I suppose it's possible for this to give you as low as 0, but it could also go higher.

  • \$\begingroup\$ Great idea but unfortunately it doesn't calculate anything. \$\endgroup\$ – user80551 Jun 13 '14 at 14:54
  • 3
    \$\begingroup\$ I do believe the *99 part invokes a calculation. \$\endgroup\$ – commando Jun 13 '14 at 14:55
  • \$\begingroup\$ Oh yes, /me feels stupid now. \$\endgroup\$ – user80551 Jun 13 '14 at 14:59
  • 1
    \$\begingroup\$ If you use something shorter - say id(id) or id(0j), you can multiply by 999 \$\endgroup\$ – gnibbler Jun 13 '14 at 15:10
  • 1
    \$\begingroup\$ Out of smaller named ones in docs.python.org/2/library/functions.html , vars consistently gives the highest value(but 4 chars) followed by sum. Use print(sorted([(id(x),x)for x in[id,len,max,min,str,int,ord,chr,sum,map,abs,all,any,bin,bool,eval,oct,vars,iter,list,set,repr,round,zip,type,pow,dict,dir,hex]])[::-1]) to check. \$\endgroup\$ – user80551 Jun 13 '14 at 15:49

Golfscript, 1e+33,554,432


Computes 10 ^ (2 ^ 25), without using exponents, runs in 96 seconds:

$ time echo "10{.*}25*" | ruby golfscript.rb  > BIG10

real    1m36.733s
user    1m28.101s
sys     0m6.632s
$ wc -c BIG10
 33554434 BIG10
$ head -c 80 BIG10
$ tail -c 80 BIG10

It can compute up to 9 ^ (2 ^ 9999), if only given enough time, but incrementing the inner exponent by one makes it take ~triple the time, so the one hour limit will be reached pretty soon.


Using a previous version with the same idea:


Breaking it down:

8         # push 8 to the stack
{...}25*  # run the given block 25 times

The stack at the start of each block consists of one number, the current number. This starts off as 8. Then:

.         # duplicate the top of the stack, stack is now | 8 | 8 |
*         # multiply top two numbers, stack is now       | 64 |

So the stack, step by step, looks like this:

8 8
64 64
4096 4096
16777216 16777216

... etc. Written in math notation the progression is:

n=0, 8                     = 8^1  = 8^(2^0)
n=1, 8*8                   = 8^2  = 8^(2^1)
n=2, (8^2)*(8^2) = (8^2)^2 = 8^4  = 8^(2^2)
n=3,               (8^4)^2 = 8^8  = 8^(2^3)
n=4,               (8^8)^2 = 8^16 = 8^(2^4)
  • \$\begingroup\$ What's the deal with the two one's in front of the 2564 in your output? \$\endgroup\$ – Kyle Kanos Jun 13 '14 at 16:19
  • \$\begingroup\$ @KyleKanos: That's not my output, it's the output of wc. I'll edit to make it clearer \$\endgroup\$ – Claudiu Jun 13 '14 at 16:20
  • \$\begingroup\$ you could use wc -c to make the output clearer \$\endgroup\$ – daniero Jun 13 '14 at 16:29
  • \$\begingroup\$ Nice! I had the same idea a few minutes ago, but it runs much slower with CJam (which is surprising, since it's faster than GolfScript in general). \$\endgroup\$ – Dennis Jun 13 '14 at 16:44
  • 1
    \$\begingroup\$ Minor improvement: 10{.*}25 delivers 33,554,434 digits and finishes in 90 second on my machine. I don't know why, but 10{.*}26* prints nothing. \$\endgroup\$ – Dennis Jun 13 '14 at 19:31

wxMaxima ~3x1049,948 (or 108,565,705,514 )


Output is

269146071053904674084357808139[49888 digits]000000000000000000000000000000

Not sure if it quite fits specs (particularly the output format one), but I can hit even larger:


Output is


That's roughly 108,565,705,514 which is significantly larger than most of the top answers and was computed in about 2 seconds. The bfloat function gives arbitrary precision.


Haskell, 4950

Aww man, that's not a lot! 10 characters start after the dollar sign.

  • \$\begingroup\$ Why not just print? Also, 9/0.000001 is greater than sum[1..99]. \$\endgroup\$ – Taylor Fausak Jun 13 '14 at 19:11
  • 5
    \$\begingroup\$ At that rate, we might consider 9 999 999 999 to be a lower bound on results. \$\endgroup\$ – Keen Jun 13 '14 at 20:22
  • \$\begingroup\$ @TaylorFausak This answer is obviously not to be taken seriously! \$\endgroup\$ – Flonk Jun 16 '14 at 10:23

Mathematica, 2.174188391646043*10^20686623745


Ten characters exactly.

  • 7
    \$\begingroup\$ Is it technically calculating anything, and is it outputting all the digits and not just scientific notation? \$\endgroup\$ – user15259 Jun 13 '14 at 20:12
  • \$\begingroup\$ @Yimin: The output may be in any format (so you can print 999, 5e+100, etc.) \$\endgroup\$ – edc65 Jun 13 '14 at 23:14
  • \$\begingroup\$ The value is not set at compile-time, but depends on the particular machine on which the command is run. I think it counts. \$\endgroup\$ – Michael Stern Jun 13 '14 at 23:25

Python shell, 649539 999890001

Beats Haskell, not really a serious answer.

  • 6
    \$\begingroup\$ 9999999999 is larger, isn't it? \$\endgroup\$ – MadTux Jun 13 '14 at 13:59
  • 5
    \$\begingroup\$ @MadTux There is an ambiguous restriction to calculate the answer. \$\endgroup\$ – user80551 Jun 13 '14 at 13:59
  • 1
    \$\begingroup\$ If this answer is correct, then mine 9**9**9**9 is correct either, as it's arithmetic operator (not built-in func). \$\endgroup\$ – kenorb Jun 14 '14 at 13:28
  • 3
    \$\begingroup\$ @kenorb It's built in exponentiation that's not allowed. \$\endgroup\$ – user80551 Jun 14 '14 at 13:30

Wolfram Alpha (does a website count as a language)?

9! ! ! ! !



thanks to Cory for the tip that spaces work as well as parens.

  • \$\begingroup\$ I'm pretty sure this is the biggest number in the thread as of my post but Wolfram chokes on comparing it to other numbers, even ((99!)!)! > 4 never returns. \$\endgroup\$ – gggg Jun 13 '14 at 22:27
  • \$\begingroup\$ This goes against the rule that says you can't get it from the Web. \$\endgroup\$ – Kyle Kanos Jun 14 '14 at 2:13
  • 1
    \$\begingroup\$ Too many W|A's! \$\endgroup\$ – Anonymous Pi Jun 15 '14 at 17:37
  • 5
    \$\begingroup\$ I disagree that this breaks the rules. It doesn't "read it from the web" which is against the rules, it does in fact "calculate a single number and print it" which is what is it supposed to to. The fact that the only available interface is a website doesn't mean it can't count as a programming language. \$\endgroup\$ – gggg Jun 16 '14 at 15:23
  • 1
    \$\begingroup\$ It is a completely valid answer. \$\endgroup\$ – microbian Jun 19 '14 at 17:53

Befunge-93 (1,853,020,188,851,841)

Glad nobody has done Befunge yet (it's my niche), but dammit I can't find any clever trick to increase the number.


So it's 9^16.


Basically multiplies the value at the top of the stack with itself. So, value at the top of the stack goes:




Outputs the final value. I would be interested to see if anybody has any better ideas.


I'd rather post this as a comment above, but apparently I can't since I'm a noob.



I'd go with a larger bit shift, but Python seems to want the right operand of a shift to be a non-long integer. I think this gets closer to the theoretical max:


The only problem with these is that they might not satisfy rule 5.


Matlab (1.7977e+308)

Matlab stores the value of the largest (double-precision) floating-point number in a variable called realmax. Invoking it in the command window (or at the command line) prints its value:

>> realmax

ans =

  • \$\begingroup\$ Since the OP asked to return a calculated value, you should put realmax+1. I tried it for fun and surprise it returns exactly the same number than you have (then I laughed when I realized ... eps(realmax)=1.99584030953472e+292 ). \$\endgroup\$ – Hoki Jul 7 '15 at 11:39

Python, ca. 1.26e1388





At least Python 3.5.0 (64-bit), more than 10^242944768872896860

print("{:x}".format( 9<<(7<<60) ))

In an ideal world, this would be 9<<(1<<63)-1, but there aren't enough bytes for that. This number is so big that it requires almost 1 EiB of memory to hold it, which is a little bit more than I have on my computer. Luckily, you only need to use around 0.2% of the world's storage space as swap to hold it. The value in binary is 1001 followed by 8070450532247928832 zeros.

If Python comes out for 128-bit machines, the maximum would be 9<<(9<<99), which requires less than 1 MiYiB of memory. This is good, because you'd have enough addressable space left to store the Python interpreter and the operating system.

  • \$\begingroup\$ "Only 0.2% of the world's storage space" \$\endgroup\$ – Benjamin Urquhart Apr 13 '19 at 20:51
  • 1
    \$\begingroup\$ @BenjaminUrquhart If you think it's good, why not upvote? \$\endgroup\$ – wizzwizz4 Apr 13 '19 at 20:58
  • \$\begingroup\$ There's your double upvote ;) \$\endgroup\$ – Benjamin Urquhart Apr 13 '19 at 20:58

Cubix, 9.670457478596419e+147 (non-competing)


Non-competing because Cubix is newer than this challenge. You can test it online here, but note that it doesn't actually print the number; you'll have to pause the program after the last two *s are run to see the value on the stack.

How it works

Cubix is a 2-dimensional esolang where the code is wrapped around a cube. This code is exactly equivalent to the following cube net, where . is a no-op:

    * *
    * *
" / / / * * . .
. . . . . . . .
    . .
    . .

Then the code is run, with the instruction pointer (IP) starting on the top-left corner of the leftmost face, facing right. " turns on string mode, where all chars encountered until the next " push their char-codes to the stack. The IP wraps all the way around the code, pushing three /s (47), two *s (42), and two .s (46) to the stack, before exiting string mode again.

Here's where it gets interesting. The first mirror / reflects the IP so it's facing up; it then rotates around the cube, hitting these chars:

    * *
  /     *      
  .     .      
    . .

The three *s multiply the top two items on the stack. Now, unlike most stack-based languages where arithmetic operators pop their arguments, Cubix leaves the previous values on the stack. So that means this calculates 46*46 = 2116, 46*2116 = 97336, 2116*97336 = 205962976.

When the IP reaches the / again, it is turned right. It then hits the next mirror and follows this path:

    /         .
    .         .

The two asterisks multiply the top two items once more. Then the mirror directs the IP right again, and the third mirror repeats the process once more:

      /     .  
      .     .  

Finally, the IP leaves the mirror section heading east. The two finaly asterisks multiply two more times, leaving a result of 9.670457478596419e+147 on the stack. This could be printed with O, but there's no easy way to do that since practically every spot on the cube is already used.


Casio fx-350 ES PLUS, approx. 9.999882753E99

Do calculators count?

At 70! the calculator throws error because apparently it has a number range limit -1E100 ~ 1E100

  • \$\begingroup\$ I... don't think this counts as a programming language? \$\endgroup\$ – Simply Beautiful Art Aug 2 '19 at 18:49
  • \$\begingroup\$ Well I guess there's another calculator answer so this is probably fine. \$\endgroup\$ – Simply Beautiful Art Aug 2 '19 at 18:52

Scala, 263-1

Poor, poor Scala. Takes at least 8 characters to get a BigInt value, which doesn't leave enough room to actually make it big.

But with only 7 characters of (counted) code, we can print the largest possible positive Long:


Brainf**k 256 - 2147483647


If you ignore the fact that most compilers & interpreters output data as it's ascii equivalent (be leanient, it is what it is ;) ), this will return the maximum value of the interpreter/compiler's datatype.

On some systems this is just 256, although on some (mine for example), this is the max value of a 32 bit integer, ie 2 147 483 647.



Will print the same thing in many fewer characters

  • \$\begingroup\$ That second answer will print -1 on interpreters that use signed values for the tape \$\endgroup\$ – Benjamin Urquhart Apr 13 '19 at 23:46

Perl, non competing

I'm using this to highlight a little know corner of perl.

Perl can't really compete on this one because it doesn't have builtin bignums (of course you could load a bignum library).

But what everybody knows isn't completely true. One core function actually can handle big numbers.

The pack format w can actually convert any size natural number between base 10 and base 128. The base 128 integer is however represented as string bytes. The bitstring xxxxxxxyyyyyyyzzzzzzz become the bytes: 1xxxxxxx 1yyyyyyy 0zzzzzzz (every byte starts with 1 except the last one). And you can convert such a string to base 10 with unpack. So you can write code like:

unpack w,~A x 4**4 .A

which gives:


You can replace the 4**4 by larger values until you feel it takes too long or uses too much memory.

Unfortunately this is way too long for the limit of this challenge, and you can argue that the base 10 result is converted to a string before it becomes the result so the expression doesn't really produce a number. But internally perl really does the needed arithmetic to convert the input to base 10 which I always considered rather neat.


TI-36 (not 84, 36), 10 bytes, approx. 9.999985426E99

Older calculators can be programmed to an extent as well ;)


This is very close to the maximum range a TI calculator can display: -1E100<x<1E100

enter image description here


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