The Library of Babel

I was thinking about the Borges story The Library of Babel (which you can read here, and browse random books from here) l and I got to wondering whether anyone had done any decent renderings of it.

The universe (which others call the Library) is composed of an indefinite and perhaps infinite number of hexagonal galleries, with vast air shafts between, surrounded by very low railings. From any of the hexagons one can see, interminably, the upper and lower floors. The distribution of the galleries is invariable. Twenty shelves, five long shelves per side, cover all the sides except two; their height, which is the distance from floor to ceiling, scarcely exceeds that of a normal bookcase. One of the free sides leads to a narrow hallway which opens onto another gallery, identical to the first and to all the rest. To the left and right of the hallway there are two very small closets. In the first, one may sleep standing up; in the other, satisfy one's fecal necessities. Also through here passes a spiral stairway, which sinks abysmally and soars upwards to remote distances. In the hallway there is a mirror which faithfully duplicates all appearances. Men usually infer from this mirror that the Library is not infinite (if it were, why this illusory duplication?); I prefer to dream that its polished surfaces represent and promise the infinite ... Light is provided by some spherical fruit which bear the name of lamps. There are two, transversally placed, in each hexagon. The light they emit is insufficient, incessant.

I was disappointed to find that my go-to resource for such things, The Dictionary of Imaginary Places, had no illustration to go along with its entry.

One edition of the book had as its cover one of the illustrations of the library by Érik Desmazières, which are gorgeous, but have a wanton disregard for nearly every particular in the text, so we can pretty much just ignore this one:

So there's Alex Warren's take, which is nicely symmetrical:

However, I think there are several major misreadings here.

  1. The text pretty clearly states that there is only one door from each hexagon to the hallway. To connect the hexagons as shown here requires two or more doors per room.

  2. There is one bookcase on each of 4 walls. Not multiple bookcases, and not on 5 walls.

  3. Each shelf of each bookcase contains 35 books of 410 pages. Even assuming rather thick paper, each of those books would be less than 2" thick, yielding a bookcase less than 6' wide. So the rooms are probably a lot smaller than shown.

  4. The sleep chamber, lavatory and hallway aren't shown.

This image by Andrew DeGraff has an interesting positioning of the stairs, but makes the same mistakes about the number of doors, and omits the hallways.

Thomas Basbøll thinks that since there can only be one door, the library must consist of pairs of hexagonal rooms, which implies that the library must be a tower, immensely tall but not very wide:

But if Borges had meant a tower, I think he would have said a tower, and probably would have used the word "floor" more often instead of words like "region" and "circuit", and wouldn't have said, "If an eternal traveler were to cross it in any direction..."

I think WillH's comment here has the right idea: if the un-described sixth wall is not a wall at all, and sets of six rooms are arranged into pods, it all works out. "Air shafts between" could be interpreted as "between rooms" rather than "between shelves".

That does leave weirdly-shaped unreachable voids between the pods. But at one point he speaks of "in a hexagon on circuit fifteen ninety-four", and the word "circuit" fits well with this circular arrangement.

Kate and Andrew Bernheimer came up with this one, which has the "circuit of hexagons" idea, but links them all into a circle around a void, and again seems to omit the hallways.

Various other illustrations of it that I've seen seemed to assume that the sleep chamber and lavatory open off of the hallway, but "To the left and right of the hallway there are two very small closets" sounds to me like those closets are on the same wall as the entrance to the hallway, that is, they open into the hexagonal room. So that gives us a minimum length of each wall of about 10' (assuming pre-ADA, sub-OSHA standards of construction). That means the bookcases can't possibly fill the whole wall unless there is a lot of empty space on them, or the books themselves are each like 40" thick.

Where does the spiral staircase go? Again, a lot of illustrators stuck it off of the hallway, but it doesn't read that way to me. It sounds to me like there is a spiral stairway within each of the hexagonal book rooms. It might wrap around the air shaft, but I think that's a tortured interpretation.

Well, I fired up Sketchup and took a crack at my own version of it. Fun fact: Sketchup does very poorly with a vast number of objects, even if those objects are wrapped up in "components", most of which are invisible. The file is 400KB but the thing is using almost 2GB of RAM and hypnowheeling constantly for 90+ seconds at a time. Hooray.

I haven't added the stairwells, and I kind of think the "corridors" need to be longer to earn that word. Also those enormous and oddly-shaped voids between "circuits" of rooms bother me. So I don't think this is quite right either.

Wikipedia says that there are 251,312,000 or 1.956 × 101,834,097 possible books. That's a lot of books.

with 700 books per room, and the rooms laid out with approximately the same number of rooms on all three axes, I think that means it is roughly 10611,364 rooms wide and floors tall before you reach the end?

I can't help but think about the weight and pressure of a column of air that high, and what is it sitting on, and how to route the plumbing from all of those toilets, and that toilets imply digestion, so where does the food come from? Is there a section of the library devoted to farming, and metallurgy? But now I'm overthinking a sub-infinite but nearly boundless hill of beans.

Update: Hey folks, the comments on this post have been fantastic. If you've been reading this blog for a while, you know that that is, uh, often not the case. So thank you all for playing along. Anyway, I've done some more Sketchup layouts which you can see in the followup post:

Tags: , , , ,

52 Responses:

  1. Jeremy says:

    This is a pleasing arrangement, though it does make the assumption that the components of the library are packed; is there a reason not to posit voids between rooms?

    • jwz says:

      The fact that he chose hexagons implies to me some kind of ideal packing; that's what hexagons are for, after all. But I'm not sure there's a way to avoid voids.

  2. Ben Rosengart says:

    Since digital photos are integers, therefore enumerable, there could also be a Photolibrary of Babel.

    Even limiting it to 8MP photos, it would be a lot of photos.

    • Keith Wiley says:

      I describe that exact concept in my book, if you're curious: A Taxonomy and Metaphysics of Mind-Uploading. I describe (and calculate) the set of all possible pixelated images, pointing out that, of course, most of them are just snow.

  3. Awesome. I would love to make a version of this you could walk around in WebVR. Any chance you're planning on making the model file available? Really just need to break it down to the unique components (one model per unique room) and an algorithm to lay them all out. They can then be connected via portals, allowing infinite traversal.

  4. MattyJ says:

    > examine book

  5. JHL says:

    >>> Thomas Basbøll thinks that since there can only be one door, the library must consist of pairs of hexagonal rooms, which implies that the library must be a tower, immensely tall but not very wide

    This is incorrect to me. If the staircase is in the hexagonal room, you can move up and down to find a connection in another direction.

    This is how I pictured it anyway, the rooms being connected in pairs randomly, in a 3D grid like layered honeycomb. You would have to move up and down constantly, and since the connections are random, it would be very maze-like and hard to move far in any direction but up-down.

    Also, to try to find a limit, I think it would make the most sense to form a clan going straight down, marking the rooms somehow in case you circled around back to the top.

    • jwz says:

      Sure, if each pair of rooms has two stairwells total then that pair is a cons with reversible pointers, and the library is a sexpr or an undirected (presumed acyclic) graph.

      That's not how he drew it, though.

  6. pavel_lishin says:

    Also through here passes a spiral stairway, which sinks abysmally and soars upwards to remote distances.

    To me, it reads like the spiral stairway passes through the hallway itself - but I don't know what it says in the original Spanish.

    It would definitely make your voids bigger, unless you shove the spiral staircases into the voids themselves - but it seems to indicate that only one staircase is accessible from each hallway, and doesn't say which side it should be on.

    • pavel_lishin says:

      Another thought occurs - could he have deliberately left the description either ambiguous or flat-out geometrically impossible?

      • jwz says:

        Well now you're just being mean.

        • Michael Wolf says:

          We're talking about an author who wrote and published reviews of books that were never actually written.

          I wouldn't rule it out.

          • Epsz says:

            Also, when he was the Director of the National Library of Argentina he added an index card indicating the library contained a copy of the Necronomicon. So he was not above pranking the unwary.

      • tfb says:

        Although it's a long time since I read it, I suspect it may well be buggy / impossible. For instance it's not clear to me that the library is finite, although Borges (or the protagonist) obviously thought it was (if I remember). He talks about the possibility of finding 'the catalogue' (or index, or something) in the library. But this would be multiple books, so if each book only occurs once then it is almost certainly scattered irretrievably. But perhaps each possible room occurs ... but now you need to consider each possible collection of rooms and it's obviously horribly non-finite (and the catalogue of course is also non-finite).

        Obviously that isn't anything to do with the geometry, but I think it's just not completely thought-through.

    • jwz says:

      Since he says "also through here..." and then, "In the hallway..." it sounds like "here" is not "in the hallway", which would make it "in the room", but I Also don't know how precise the translation is.

      • pavel_lishin says:

        Nothing adds class and ambiance to a bathroom like a spiral staircase.

      • zompist says:

        The immediate context is speaking about the vestibule (a better translation for zaguan), so "here" (por ahi) probably does refer to the vestibule.

        More interestingly, I think: previously he says "A izquierda y a derecha del zaguan hay dos gabinetes minusculos." That is, the two small cabinets are on the left and right sides of the vestibule... not, as most of these renderings have it, on either side of the door to the vestibule.

        That is, that side of the room doesn't have three doors. It has one door, into the vestibule. The vestibule has doors on all four sides: two leading to galleries, two to the cabinets.

        • jwz says:

          So all six sides, then, I suppose: rooms, cabinets, and entry and exit for the spiral staircase.

          • andyjpb says:

            When I read it I understood the staircase to be in the toilet.

            ...but then I also assumed it to be infinite. The text says that when someone dies that they are cast over the handrail. If the library is infinite then they fall forever. A friend and I tried to do a limit analysis of whether the air columns are therefore sparse or dense with bodies. If you're standing looking over the handrail, how likely are you to see a body fly past?
            We came to the conclusion that the air column would be completely full of bodies. So much so that they would scrape on the handrails on the way past. This would cause soil to build up underneath the handrails and plants would grow there.

            ...that's where the food comes from.

            • jwz says:

              Well I'd like to see your math on that. But it can't be infinite because then the books would repeat. Also, I'm guessing that it would only take something less than a few hundred million floors (single digit exponent!) before the air is less "air" than "neutronium that has had all the electrons squeezed out".

              • andyjpb says:

                If it was infinite then the mass in any direction would be equal to any other so the air (and everything else for that matter) would be effectively weightless.
                As he implies normal gravity as people move around the library, I guess we can assume a finite structure that isn't excessively tall.

  7. So there was this Fermi Paradox game jam recently:

    Some friends and I were discussing doing a library exploration game for it (but we never quite got there). Something like every page representing a star in the universe, so you have a huge library full of books and you can flip through the (99.999% blank) pages looking for one of the few pages with writing on it that represents intelligent life.

    So I guess what I'm saying is that it would be neat to make a playable version of this.

  8. thielges says:

    I sense a new xscreensaver hack about to occur. Have it implement a SETI search through the pages as Ted suggests.

    • thielges says:

      Or couple it with a million typing chimps stocking the shelves with their pages. And scan for one of The Bard's sonnets.

  9. Helyx says:

    Surprised this isn't in a previously tag:

    "At present it contains all possible pages of 3200 characters, about 104677 books.

    Since I imagine the question will present itself in some visitors’ minds (a certain amount of distrust of the virtual is inevitable) I’ll head off any doubts: any text you find in any location of the library will be in the same place in perpetuity. We do not simply generate and store books as they are requested - in fact, the storage demands would make that impossible. Every possible permutation of letters is accessible at this very moment in one of the library's books, only awaiting its discovery. "

  10. Epsz says:

    About the length of the hallways: in the original Spanish the word use to describe them is "zaguán", not "pasillo". A "zaguán" is a small covered space leading from the interior of a house to the exterior, like a waiting room or an entry hall. A hallway is something entirely different, but in this context the word seems hard to translate. The text is after all written by someone who has never seen a house.
    Let me know if you have any questions that could be solved by the original text.

  11. Scott Madin says:

    If you haven't seen it, there's an interactive implementation, which posits the "corridors" as square rooms with four doorways, and the hexagons in rows and columns intersecting them. However, it does render only a single floor, omitting air shafts, stairwells, sleep closets, and lavatories.

  12. Angus says:

    Regarding the two empty walls but only one connector ambiguity there is this (from

    The first version of Borges’ “La Biblioteca de Babel”, published in 1941, contained the same description, excepting two words: each hexagon contained 25 bookshelves, five each covering five walls. In 1956 Borges changed the text, presumably because he had recognized his error.

    This is the trickiest part: he changed twenty-five to twenty, changed “each of the walls less one” to “each of the walls less two,”

    Your JEI/James E Irby/Princeton translation is published in Labyrinths.

    Here is a more recent/alternative translation from Collected Fictions (trans. Andrew Hurley):

    The universe (which others call the Library) is composed of an indefinite, perhaps infinite number of hexagonal galleries. In the center of each gallery is a ventilation shaft, bounded by a low railing. From any hexagon one can see the floors above and below -- one after another, endlessly. The arrangement of the galleries is always the same: Twenty bookshelves, five to each side, line four of the hexagon's six sides; the height of the bookshelves, floor to ceiling, is hardly greater than the height of a normal librarian. One of the hexagon's free sides opens onto a narrow sort of vestibule, which in turn opens onto another gallery, identical to the first -- identical in fact to all. To the left and right of the vestibule are two tiny compartments. One is for sleeping, upright; the other for satisfying one's physical necessities. Through this space, too, there passes a spiral staircase, which winds upward and downward into the remotest distance. In the vestibule there is a mirror, which faithfully duplicates appearances. Men often infer from this mirror that the library is not infinite -- if it were, what need would there be for that illusory replication? I prefer to dream that burnished surfaces are a figuration and promise of the infinite. ... Light is provided by certain spherical fruits that bear the name "bulbs." There are two of these bulbs in each hexagon, set crosswise. The light they give is insufficient, and unceasing.

    Note also that the library's books have permutations of only 25 symbols (including punctuation) "the space, the period, the comma, and the twenty-two letters of the alphabet", ie a 22-letter alphabet not the 30 "letters" of modern Spanish, nor the 26 of English (see again

    • jwz says:

      Well, that translation pretty clearly says that the shafts are within the hexagonal rooms, and seems to go out of its way to say nothing about the Mystery Wall. Great.

      Since it is also exp'icit about the stairway being in the vestibule, that takes us back to the "tower" model, unless we invent some second horizontal path out of each hexagon.

      Epsz, any opinions on this translation?

      • Angus says:

        I'd suggest that "ONE of the hexagon's free sides" should read "EACH of the hexagon's free sides". Otherwise, why two free sides? While JLB is a god, given that he has corrected the text once, we can take it that he is a fallible one.

        • Epsz says:

          It's totally possible to give that reading to the original text. It reads "Uno permite dormir de pie". While the most straight forward reading would be of "uno" would be "one of them", it could also be read as "each one".

          • Nick Lamb says:

            OK, so: If we presume "each one" and thus each hexagon adjoins exactly two vestibules, then I think we can have a structure in which the hexagons are fairly closely packed and are connected seemingly haphazardly by vestibules.

            Now, with the vestibules not always aligned from one level to the next, the spiral staircases between them won't stop on every level. But that seems to be permitted, maybe even implied by the text. On average the staircase would open out onto a vestibule every three levels or so.

            As a result if you look over the railing, some of the hexagons you can plainly see below you can be reached by stepping into the nearest vestibule and simply walking down the stairs to them. Some others could be reached in a similar way, but you must use the other vestibule because its staircase stops on different levels. The remainder are connected to your current location by some more complicated route. It is entirely possible that a vertically adjacent hexagon is as topologically distant from you as any other hexagon in the entire system.

            I think this understanding is a completely satisfactory implementation of the Library, suitably confusing for its denizens, yet visually pleasing if illustrated. But perhaps I missed something ?

            • jwz says:

              "opens onto another gallery, identical to the first -- identical in fact to all"

              Neither translation specifies which of the 4 walls are the ones with shelves on them, but it does say the rooms are identical. So there are three possibilities for where the doors go: on adjacent walls; on walls separated by 1 and 3 bookcases; or opposite each other, separated by 2 bookcases.

              With adjacent walls, your only choices are a zig-zag, or tight loops of three rooms. Within a plane, once you start with one layout on a "stack" of hexagons, you have to continue that forever. There's no way to change directions without running into a conflict where a room would need to have 1 or 3 doors. However you can mix and match zig-zag and triangles within the plane, and each plane could have a different pattern of them, and could be rotated 60° from each other.

              In the "101000" pattern, you end up with wider zig-zags, or closed loops of six rooms. Both patterns necessitate voids. (Maybe that's where the plumbing goes.) Again, you can't change direction within one floor, but the two styles can be mixed up.

              (Oh hey, also closed loops of an arbitrary number of cells, with some voids for buffering. I just noticed that.)

              In the "100100" pattern, you just get straight lines. And you have to continue those in the same direction forever. No changing direction within the plane.

              If the rule was "every room has 2 doors, and they can go wherever", or "some rooms have 1 or 3 doors", then much more complicated patterns would be possible (spirals and such). But to me "identical" says that every room has the same number of doors in the same relation to each other.

      • Nick Lamb says:

        It really doesn't feel as though any translators have tried very hard to imagine the thing described as part of their process. It might be that the original text defies realisation in one or more ways and they all give up and just try to communicate the general vibe, but without knowing Spanish I can't tell.

        Your earlier text at least mentions the idea of a "bookcase", which this Hurley translation does not. Is it somehow possible Borges, or Hurley, weren't aware of what a bookcase is? Or are we to believe the "books" in this library stand as tall as a person and so need these tremendously tall shelves?

        A library that "feels" like a maze, with it being possible to see an adjacent hexagon without knowing how to reach it suits the maddening atmosphere Borges seems to have intended. So perhaps the best way forward is to treat the actual description, and particularly translations of it, as a little unreliable, and focus on creating something that delivers the right "feel" even if it's not entirely faithful to some particular text.

        After all the Library contains not only a complete and correct index to its own contents, but also a tremendous number of indices each correct except for one error; likewise it must contain a considerable number of incorrect descriptions of the library itself. After interminably wandering the Library for aeons, the ultimate irony would be to stumble upon a book that seems to make sense except that it insists the Library's rooms each have seven sides...

        • Epsz says:

          The translation on the original post is wrong. Borges says the height of the bookshelves(and the height of the room) is scarcely more than that of a normal librarian. Hurley's translation matches the text better.

          What is the difference between a bookcase and a bookshelf? In my mind they are synonymous, and a google search is not helping em find any difference (other than the fact that a shelf can sometimes refer to a single level, while a case always is multiple?)

          • jwz says:

            A shelf is a horizontal plank, a case is a vertical stack of them. But yeah, people often use the words interchangeably.

  13. Shea says:

    a) I have now lost count of how many things in digital, musical, and print culture to which this blog has introduced me over the years. (I have been living under a rock.) So thank you for that.

    b) Wow, you really weren't kidding about not sleeping.

  14. Miguel says:

    Native Spanish speaker here. I found a link to the original story in Spanish.

    The relevant passage is quoted below so it's easier to reference:

    El universo (que otros llaman la Biblioteca) se componte de un número indefinido, y tal vez infinito, de galerías hexagonales, con vastos pozos de ventilación en el medio, cercados por barandas bajísimas. Desde cualquier hexágono se ven los pisos inferiores y superiores: interminablemente. La distribución de las galerías es invariable. Veinte anaqueles, a cinco largos anaqueles por lado, cubren todos los lados menos dos; su altura, que es la de los pisos, excede apenas la de un bibliotecario normal. Una de las caras libres da a un angosto zaguán, que desemboca en otra galería, idéntica a la primera y a todas. A izquierda y a derecha del zaguán hay dos gabinetes minúsculos. Uno permite dormir de pie; otro, satisfacer las necesidades finales. Por ahí pasa la escalera espiral, que se abisma y se eleva hacia lo remoto. En el zaguán hay un espejo, que fielmente duplica las apariencias. Los hombres suelen inferir de ese espejo que la Biblioteca no es infinita (si lo fuera realmente ¿a qué esa duplicación ilusoria?); yo prefiero soñar que las superficies bruñidas figuran y prometen el infinito... La luz procede de unas frutas esféricas que llevan el nombre de lámparas. Hay dos en cada hexágono: transversales. La luz que emiten es insuficiente, incesante.

    The translation in the comments was actually fairly accurate. Regarding the hallways ("zaguanes"), the text only talks about one of the walls giving way to a narrow hallway ("Una de las caras libres da a un angosto zaguán"), then proceeding to join to another gallery. So the translation is again accurate, sadly the one-or-two wall debate is just not defined in the original text.

    As for the two compartments, the text refers to them as "uno" and "otro" - so one and the other, implying only one is for sleeping; the other only for "necesidades finales" - literally "final necessities". Whether this is taken to mean defecation like in the older translation or biological necessities, like the newer translation in the comments above is up to the reader I guess. I would side with the biological necessities interpretation - perhaps even food/water might be obtained in those.

    • PaulJBis says:

      Umm... what? My edition (the Alianza Libro de Bolsillo one) says clearly "necesidades fecales".

      (Native spanish speaker here too).

  15. Cat Mara says:

    I love you, Milkman Jamie.

  16. Is it possible the rooms are connected via >3 dimensions, like the tesseract in "'—And He Built a Crooked House—'"?

  17. db48x says:

    The books don't have to be huge; perhaps they're displayed face-out instead of spine-out, like magazines usually are.

    Also, I found an index to the library. Alas, it's only 22 pages long, and I don't know what order to read them in...

  18. Frank Hecker says:

    "But now I'm overthinking a sub-infinite but nearly boundless hill of beans." Definitely. One of the great things about "The Library of Babel" is that in addition to being a fun exploration of the concept of a universal library, it's also a pointed satire on the type of people who haunt real-life libraries: Food and drink go unmentioned because the library-goers ignore actual hunger and thirst in their hunger and thirst for what they find in books. (Not to mention that real-life libraries traditionally don't allow eating and drinking.) However they can't ignore the need to piss or shit (especially the older ones with prostate problems), and they'll occasionally nod off; hence Borges made (minimal) provision for these particular biological needs. (Of course, what to do with all the human waste is a problem for other people to worry about: plumbers, not scholars.)

    Also unmentioned are women, although the narrator mentions his own birth and elsewhere refers to "young men", implying at least some ongoing reproduction--although he also says the population is declining, so preumably what women there are are few and far between, and mostly unavailable for mating (as in the libraries Borges would have been familiar with).

  19. DoIMustIHaveAUsername? says:

    First, you completely forgot typical library furniture. Second, the mirrors must boo positional to the doorways to duplicate the library and not the hallway. And for sleeping, they strap in like astronauts so that they can fit, and there is no reason not to fill the empty? Spaces (not neccicarily empty-the rooms are hexagonal, the exterior walls don't have to be) with sleeping centrifuges to make it easier on the celestial inhabitants.

    • DoIMustIHaveAUsername? says:

      Alright, I have no units of measurement, so I'll go with your image of a wall to the book rooms, and call it 1. You take a honeycomb layout, and cut rows into it so that it looks somewhat like Borges motel, but with each exterior measurement at 1, as well as the interior ones. Cut doors in the up and down of the book section measuring .5, (so that there is sufficient and possibly extravagant space for the infinite mirroring) opposing the doorways place a mirror, in front of the half hexagon space, ending in a door. (No measurement given because door width varies) add in another wall between the half hexagon spaces, on one side of it you have a bathroom with a sink, a bathtub/shower, and a toilet. On the other side put astronaut harnesses to hold people upright. (Or add in a centrifuge if you want to give the celestial beings more comfort//be extravagant//add in unusuality) duplicate this setup ad infinitum on every other floor. For the spiral staircase, place it in the hallways created by the half hexagon pattern, it will go between the doors (either for the bathroom and sleeping chamber, or sleeping chamber and bathroom, depending on how you see the patern) that way the mirroring is uninterrupted. Between the bookcases and the next wall (as you pointed out there will be space-especially if you have to make the hole in the center of the room large enough for a body to fall through without deviating from course enough to to hit the railings or land in the book rooms) you place furnishings such as chairs and possibly sofas. On the other floors (I said every other floor for a reason see) you place habitats, the railing passing these floors would have a cage around them, with a door and latch to keep animals contained, and plants from destroying the stairs. These habitats would resemble more farms and orchards, than wildlife, and would be worked by the celestial a when they are not searching for some book to read. The food pick up would need to be on these floors, and the workers would be anyone who walked in and worked, as it would be too easy to get lost. There is no material for currency except for leaves and bones, but in order to have currency, you need contention values and personal ownership, which do not exist because materials are too abundant.