str
text
1# str: text in double quotes2"héllo\tworld"3# in double quotes4"hello"5# with values inside braces6"1 + 1 = {1 + 1}""1 + 1 = 2"Example outputCtrl+Enter to run
syntax
Section titled “syntax”1# + joins, * repeats2"ab" * 3"ababab"3# s[i] and s[a..b] pick characters4"hello"[1..3]"el"Example outputCtrl+Enter to run
Functions that take it
Section titled “Functions that take it”warnprint a warning to stderr, dimmed in a terminal, and carry onfailstop with an error messageeditopen a full-screen editor to type or paste text into, starting from textintconvert to an integer, dropping any fractional partfloatconvert to a floatlistconvert to a list: a string’s characters, a map’s [key, value] pairs, a set’s items, a table’s rows as maps, or a copy of a listdesugarshow what shell-style command lines mean: src with each one rewritten as the ordinary zil call it runsparsedhow src groups, with each operation that is an operand of another in parenthesesparseread a value written in zil syntax from text: a number, string, list, map or quantitysearchfunctions whose name or description mentions a word, as textreadthe contents of one or more files, as text joined into one string, or as bytes with the bytes flagread_filethe contents of one or more files, joined into one stringread_bytesa file’s contents, as bytes, for files that aren’t textsave_sessionwrite the session’s variables, functions and units to a file as code that rebuilds themexistswhether a file or directory existsis_dirwhether path is a directory (folder)lswhat’s in a directory, as a table of name, type, size and modifiedduthe biggest files and folders directly in dir, largest first, with each folder counted for everything inside itglobevery path that matches the pattern pat, as a table like ls givesfile_sizea file’s size, as a quantity in bytesmtimewhen a file was last changed, as a datermdelete files and empty directoriesmvmove or rename files and directoriescpcopy filesmkdircreate directories, along with any missing folders above themabspaththe full path from the root of the file system, filling in the current directorycdchange the current directory and return the new oneenvthe value of an environment variable, or nil if it isn’t setshrun a command line through the system shell (sh, or cmd on Windows) and return what it printed, without the final newlinerunrun a command line through the system shell and return {code, out, err}: its exit code, output and error outputopenopen a file or folder with the system’s default program, and return its pathfetchdownload a URL and return its content as a stringupperthe string in UPPERCASElowerthe string in lowercasetrimremove spaces, tabs and newlines from both endscapitalizemake the first character uppercasesplitsplit into a list of pieces wherever sep appears (a string or a regex)from_wordsan English number in words, like “three hundred twelve”, as an integerlinessplit into a list of linescharssplit into a list of single charactersreplacereplace every match of pat with the given textstarts_withwhether s starts with prefixends_withwhether s ends with suffixmatchthe first match of a regex, or nil if there’s nonefind_alla list of every match of patgrepthe lines of a string, or items of a list, that contain patrepeatthe string repeated n timesnumsevery number found in a string, as a list of numbersstrip_ansiremove the hidden codes that color terminal text or move the cursor, leaving the plain texttruncateshorten to at most n characters, ending in … if anything was cutwrapbreak lines between words so none is longer than width charactersdedentremove the indentation that every non-blank line has in commontitleCapitalize The First Letter Of Each Wordsnakerewrite as snake_case: lowercase words joined by _camelrewrite as camelCase: words joined with no separator, each after the first capitalizedkebabrewrite as kebab-case: lowercase words joined by -sluga lowercase version for use in a URL: only letters and digits, with - between wordswordsa list of the words, with punctuation removed except apostropheswccount lines, words and bytes, like the Unix wc toolword_counthow many words there are, counted as words doesdistancethe edit distance: how many single-character changes turn a into bhamminghow many positions two equal-length strings differ at, the Hamming distancesimilarityhow alike two strings are, from 1 (identical) to 0 (nothing in common)closestthe option with the smallest edit distance to s, ignoring upper and lower case, or nil for an empty listdiffwhat changed from text a to b, line by line, or nil if nothing didtranslatetranslate text into the language to, named by code or English name, like “es”, “zh-CN” or “spanish”base64encode a string’s UTF-8 bytes in base64, the most common way to send binary data as plain text, in emails, URLs or JSONbase32encode a string’s UTF-8 bytes in base32, which avoids mixing upper and lower casebase58encode a string’s UTF-8 bytes in base58, which avoids look-alike characters such as 0 and O, as Bitcoin addresses dourl_encodemake a string safe to put in a URL, replacing other characters with % and their hex code, like %20 for a spaceunicodeeach character’s code point in the standard U+ form, like U+00E9 for éencodeencode bytes, or a string’s UTF-8 bytes, in the named formatdecodedecode text in a format encode writes, the reverse of encodedecode_autotry every format decode knows, plus rot13, bytes written as binary, octal or decimal numbers, and single-byte XOR, layer on layer up to depth deep, and list the text that comes out, the most English-looking firstflag_findfind CTF flags, prefix up to the next }, in bytes or text: as they are, and in what decode_auto’s decodings make of each run of printable text, up to 3 layers deepfrom_byte_textbytes written out as numbers separated by spaces or commas, in binary, octal, decimal or hexordthe Unicode code point (number) of a single characterbytesa string’s UTF-8 bytes, bytes made from a list of integers 0-255, or an integer’s bytesbyte_lenhow many bytes the text takes in UTF-8, rather than how many characters it hashexdumpbytes shown as a hex dump, like the xxd tool, or just n bytes around address atstringsthe readable text hidden in binary data: every run of at least min printable characters, like the Unix toolentropyhow unpredictable the bytes are (Shannon entropy)sha1the SHA-1 hash, in hexsha256the SHA-256 hash, in hexsha512the SHA-512 hash, in hexmd5the MD5 hash, in hexhmacthe HMAC of s with the secret key, in hexhash_idwhat kind of hash this looks like, from its length and format, likeliest firsthash_matchthe candidate whose hash is this one, or nil, hashing each with every algorithm hash_id suggests that zil hascrc32the CRC-32 checksum, as an integer, the same one zip files and PNG images usepath_joinjoin pieces into one path, with / or \ between them as your system usesbasenamethe last part of a path, usually the file name, or nildirnameeverything before the last part of a path, usually its folder, or nilextthe file’s extension without the dot, like “gz”, or nil if it has nonestemthe file name without its last extension, or nilcaesarthe Caesar cipher: move each letter shift places along the alphabet, wrapping from z back to arot13move each letter 13 places along the alphabetatbashswap each letter with its mirror in the alphabet: a with z, b with y, and so onvigenerethe Vigenère cipher: a Caesar shift that changes with each letter, taken in turn from the letters of the key (a shifts by 0, b by 1, …)unvigeneredecrypt text encrypted with vigenere and the same keycaesar_solveevery Caesar shift of s, the most English-looking first, as a table of shift and textsubstitution_solvefind the key of a simple substitution cipher (each letter always swapped for the same other letter) by hill climbing, assuming English, and return {key, text}affinethe affine cipher: letter number x (a = 0) becomes a × x + b, wrapping around the alphabetunaffinedecrypt text encrypted with affine and the same a and brail_fencethe rail fence cipher: write s in a zigzag down and up n rails, then read it off one rail at a timeunrail_fencedecrypt text encrypted with rail_fence and the same number of railsbaconBacon’s cipher: each letter as five A’s and B’s, its place in the alphabet in binary (a = AAAAA, b = AAAAB, …)unbacondecode Bacon’s cipher: the A’s and B’s in s, in groups of five, back to lettersmorsetext to Morse code, or Morse code back to textbrailletext to Braille characters, one per letter (uncontracted Grade 1), or Braille back to textfreqhow often each symbol appears in s, as a table of symbol, count and percent, the most common firstngramsevery run of n symbols in s with how often it appears, as a table of gram and count, the most common firstiocthe index of coincidence of s: the chance that two symbols picked from it at random are the samechi_squaredhow far the letters of s are from English letter frequencies, as a chi-squared value, where lower is closerfriedmanthe length of a repeating key, estimated from the index of coincidence by Friedman’s formulakey_lengthseach key length up to max with the average index of coincidence of the columns it splits s into, as a table of length and ioc, the highest firstkasiskithe Kasiski examination of s: runs of n symbols that appear more than once, and the key lengths their distances point to, as {repeats, factors}vigenere_solvefind the key of a Vigenère cipher by finding its length, then solving each Caesar shift by letter frequencies, assuming English, and return {key, text}analyzea quick look at the statistics of s, as a map of length, symbols, entropy, ioc, chi_squared, top and likelynatospell text out in the NATO phonetic alphabet (Alfa, Bravo, Charlie, …), as used over the phone or radioaes_encryptencrypt with AES, the standard block cipher, in mode “ecb”, “cbc”, “ctr” or “gcm”aes_decryptdecrypt AES, the reverse of aes_encrypt with the same key, mode and IVdes_encryptencrypt with DES, or Triple DES given a 16- or 24-byte key, in mode “ecb”, “cbc” or “ctr”des_decryptdecrypt DES or Triple DES, the reverse of des_encryptchacha20encrypt or decrypt with ChaCha20 (RFC 8439), a 32-byte key and a 12-byte nonce, as the same call does bothrc4encrypt or decrypt with RC4, as the same call does bothmockaLtErNaTiNg CaSe, the internet’s way of quoting someone sarcasticallyleetl33t sp34k: letters swapped for look-alike digitsuwurewrite text in cutesy internet “uwu” speakpig_latintranslate to Pig Latin, the word game where the first consonants move to the end and “ay” is addedzalgoZ̷a̸l̵g̶o̴ text: pile random accent marks onto every characterflipturn text upside down, using look-alike characters in reverse orderstyleswap letters and digits for Unicode look-alikes, like bold or scriptemojithe emoji with that name, like “taco”, or nil if there’s noneemojifyreplace :name: codes in text with their emoji, as chat apps dolenhow many items a list, map or set has, characters a string has, or bytes a bytes value hascontainswhether x is in v: text (or a regex match) in a string, an item in a list or set, or a key in a mapfindthe position of the first x in v, counting from 0, or nil if it isn’t therecounthow many times x appears in a string or listreversereverse a string or listtakethe first n items or charactersdropeverything except the first n items or charactersseta set of a list’s items or a string’s characters, or of all the arguments, with repeats droppedfrom_jsonread JSON text into zil values: objects become maps, arrays lists, and null nilfrom_csvread CSV (comma-separated) texthexan integer in hex, the same asv to hexfrom_basethe integer written in text in a base from 2 to 62, or in your own digits, the reverse of to_basephone_digitsthe digits that a phone keypad gives letters, so “FLOWERS” is “3569377”column_numberthe column number, counting from 1, of spreadsheet column lettersromana positive integer as a Roman numeral, or a numeral back to an integerrollroll dice written as in tabletop games, like “3d6+2”, and return {total, rolls}eight_ballan answer from a Magic 8-Ball toyyes_or_noa random “yes” or “no”, a little more likely to be yes on Fridaysdensitythe typical density of an ingredient in g/mL, so a volume times it gives a massdatea date from text: ISO (2026-12-25), US (12/25/2026), written out (Dec 25 2026) or plain English (next friday at 5pm, 3 days ago)formata date as text laid out by strftime codes, such as %Y for the year, %m the month, %d the day, %H:%M the time and %B the month’s namenextthe first date after d that falls on the given weekday, never d itselfcrona cron schedule in plain Englishclockthe time right now in each zone or citysunrisewhen the sun rises at a place on a day, or nil if it doesn’t rise or doesn’t set that daysunsetwhen the sun sets at a place on a day, or nil if it doesn’t rise or doesn’t set that dayday_lengthhow long the sun is up at a place on a day: 0 h if it never rises, 24 h if it never setscountryfacts about a country, found by name or ISO codecityfacts about a citygreat_circlethe distance between two places along the Earth’s surface, the shortest route, which is roughly the one planes flybearingthe compass direction to set off in from one place to reach another, in degrees clockwise from north (90 is east)zipcodelook up a postal code onlinejwtdecode a JSON Web Token, the login token many websites and APIs send, into {header, payload, signature}jwt_verifywhether a JSON Web Token’s HMAC signature matches the keyurl_parsesplit a URL into its parts: {scheme, host, port, path, query, fragment}semverparse a semantic version like “1.2.3-beta+5” into {major, minor, patch, pre, build}bumpthe next versionchmodconvert Unix file permissions between the number form, like 755, and the letters ls -l shows, like “rwxr-xr-x”ipan IPv4 or IPv6 address as a plain integer, or an integer back as an addresscidrfacts about an IPv4 block like “10.0.0.0/22”in_cidrwhether an IPv4 address is inside a block like “10.0.0.0/22”subnetssplit an IPv4 block into smaller blocks with the given prefix length, so a /22 splits into four /24sip_kindwhat an address is forportthe service that normally listens on a port number, like “ssh” for 22, or the port for a service name, or nil if unknownuuid_infowhat kind of UUID this is (its version and variant)colora color in “#rrggbb” form, from a CSS name, “#rgb”, “#rrggbb” or a list [r, g, b]rgbmake a color from red, green and blue amounts (0-255), or give one argument to get a color’s three amountshslmake a color from hue, saturation and lightness, or give one argument to get a color’s three valuesmixblend two colors, where t is how far to go from a toward b, 0 to 1lightenmake a color lighter, keeping its huedarkenmake a color darker, keeping its hueinvertfor a color, the opposite color on the color wheel, like white for blackgrayscalethe gray that looks as bright as the color doescontrasthow readable one color is on the other, as the WCAG contrast ratio from 1 (identical) to 21 (black on white)swatcha block of the color followed by its hex code, to preview itluhnwhether a number passes the Luhn check, the check digit on credit cards and phone IMEIsisbnwhether an ISBN-10 or ISBN-13 has a valid check digitibanwhether an international bank account number (IBAN) passes its check (the whole number mod 97 must be 1)mimethe MIME type for a file name or extension, like “image/png”, which is what a web server sends as Content-Type, or nil if unknownxorxor each byte with the key, repeating the key as often as needed An int key is a single byte. Xor-ing again with the same key gives back the original. Between two ints,a xor bisa ^ bAn int key is a single byte. Xor-ing again with the same key gives back the originalcyclic_findhow many bytes into the cyclic pattern sub appears, or nildrill_bitthe diameter of a drill bit written as a number like “#7”, a letter like “F” or a fraction of an inch like “1/4”, in mmtap_drillthe drill bit to use before cutting a metric thread like “M6”, as a diameter in mmbrainfuckrun a Brainfuck program and return what it printsookrun an Ook! program, Brainfuck written with the words Ook. Ook? and Ook!, and return what it printsbinaryread a compiled program or library (ELF, PE or Mach-O) into a map of what it is, what’s inside it and which security protections it was built withasmassemble x86 or x64 instructions in Intel syntax into machine code, the reverse of disasmdemangleturn a compiler-mangled symbol name back into the Rust or C++ name it came from, likec++filtmagicwhat kind of file this is, from the signature bytes it starts with, like thefilecommandpng_chunksthe chunks of a PNG file as a table of offset, type, length, data, crc and crc_okexifthe EXIF metadata of a JPEG, PNG or TIFF file as a map, like the camera, the time a photo was taken and wherepcapthe packets in a pcap or pcapng capture, as Wireshark and tcpdump save them, as a table of time, src, dst, proto, sport, dport, len and payloadflask_sessiondecode a Flask session cookie into {payload, time, signature}, without checking the signaturephp_unserializeread PHP’s serialize() format into zil valuescliparta piece of clip art from the built-in gallery by name, or with no name, the list of namesrainbowcolor text with a rainbow running diagonally across itgradientcolor text with a fade from one color on the left to another on the rightqra QR code for the text that phones can scan off the screensegmentsbig digits like a digital clock’s, for 0-9, A-F, -, ., : and spacesimgdraw an image, from its path or its bytes, width characters wide (the terminal’s width without one, or 80)lsbthe low bits of an image’s pixels as bytes, the usual way to hide a message in a picturebit_planeone bit of one color channel of an image as a black and white PNG, white where the bit is setboxeddraw a box around textsaya clip art picture saying s in a speech bubble: the cow, or any clipart() namecowsaythe same as say, named after the classic Unix programthinklike say, but in a thought bubblebesideput picture b to the right of picture a, tops lined up, with gap spaces betweenstackput picture b under picture a, lined up “left”, “center” or “right”overlaydraw picture b on top of picture a, with b’s top-left corner at column x and row y of a (counting from 0)mirrorflip a picture left to right (“h”) or upside down (“v”)rotateturn a picture clockwise by 90, 180 or 270 degreesscalemake a picture n times bigger by repeating each character n times across and n times downnegativeswap ink and background: spaces become solid blocks and the other way round, and braille dots are invertedtrim_artremove blank lines at the top and bottom, indentation every line shares, and spaces at the ends of lineslsystemgrow and draw an L-systemfractaldraw a well-known fractal by nameliferun Conway’s Game of Life for steps generations and draw the live cellschessdraw a chess board from FEN, the standard text notation for a positioncarddraw a playing card, written as its rank and suit like “A♠”, “10h” or “qd”bannerwrite s in big letters
Example results generated on 2026-11-04. Ones using now, today or randomness will differ when you run them.