gizmobench

Random State Generator

Draw one state at random, or a whole numbered list, with the USPS two-letter code beside every name. The pool is exactly the 50 states and nothing else until you say otherwise: the District of Columbia and the five territories each sit behind their own switch, and turning both on takes the pool to 56. A unique draw removes each state as it comes out, so 5 drawn from 50 leaves 45 and drawing all 50 gives every state exactly once. Narrow the draw to one of the four Census Bureau regions, copy the result as names, as postal codes, as both or as one comma separated line, and press the space bar for another set.

Draw 5Region anyDC offNo repeats
pool      50 states             DC off      territories off
mode      unique draw, without replacement

Nothing drawn yet.

Include
Repeats
Copy as

Nothing drawn yet. Draw again takes a fresh set out of the pool.

Press Space or Draw again for another set. Copy takes the draw in whichever of the four shapes is selected above: names, USPS codes, both, or one comma separated line. Up to 500 at a time, and asking for more than a unique draw can give is refused with the pool size rather than answered short.

  • Draw 550 states, unique
    no state appears twice
  • Draw all 50unique
    every state exactly once
  • DC and territories onpool becomes 56
    DC and Puerto Rico can appear
Show all 56: the 50 states, DC and the 5 territories, with postal codes
PlaceCodeRegion
AlabamaALSouth
AlaskaAKWest
ArizonaAZWest
ArkansasARSouth
CaliforniaCAWest
ColoradoCOWest
ConnecticutCTNortheast
DelawareDESouth
FloridaFLSouth
GeorgiaGASouth
HawaiiHIWest
IdahoIDWest
IllinoisILMidwest
IndianaINMidwest
IowaIAMidwest
KansasKSMidwest
KentuckyKYSouth
LouisianaLASouth
MaineMENortheast
MarylandMDSouth
MassachusettsMANortheast
MichiganMIMidwest
MinnesotaMNMidwest
MississippiMSSouth
MissouriMOMidwest
MontanaMTWest
NebraskaNEMidwest
NevadaNVWest
New HampshireNHNortheast
New JerseyNJNortheast
New MexicoNMWest
New YorkNYNortheast
North CarolinaNCSouth
North DakotaNDMidwest
OhioOHMidwest
OklahomaOKSouth
OregonORWest
PennsylvaniaPANortheast
Rhode IslandRINortheast
South CarolinaSCSouth
South DakotaSDMidwest
TennesseeTNSouth
TexasTXSouth
UtahUTWest
VermontVTNortheast
VirginiaVASouth
WashingtonWAWest
West VirginiaWVSouth
WisconsinWIMidwest
WyomingWYWest
District of ColumbiaDCSouth, not a state
American SamoaASterritory, no region
GuamGUterritory, no region
Northern Mariana IslandsMPterritory, no region
Puerto RicoPRterritory, no region
U.S. Virgin IslandsVIterritory, no region

What is in the pool, and what is not

The 50 states are the whole default pool, with the USPS two-letter codes beside them. District of Columbia is not a state and the 5 territories are not states, so each sits behind its own switch: turning both on takes the pool to 56. The regions are the four the Census Bureau publishes, which count District of Columbia in the South and give the territories no region at all, so choosing a region draws from states alone. Nothing here is uploaded and nothing needs an account: the settings stay in this browser, and the draw happens in the tab.

Accuracy. The default pool is exactly the 50 states and nothing else. The District of Columbia and the five territories are added only when you switch them on, which takes the pool to 56. A unique draw removes each state as it is picked, so the pool empties rather than repeating, and the randomness is your browser's crypto source.

Common questions

How do I get just one random state?
Set How many to 1 and press Draw again, or the space bar. The tool opens on a draw of 5 because that shows the list, the postal codes and the copy button at once, but any whole number from 1 to 500 is allowed and the setting is remembered in this browser for next time. Every draw is taken fresh from the pool, so pressing Draw again never continues the previous one.
Does it include Washington DC, Puerto Rico and the other territories?
Only if you ask. The default pool is exactly the 50 states, which is what a quiz or a classroom exercise almost always means, so the District of Columbia and the five inhabited territories (American Samoa, Guam, the Northern Mariana Islands, Puerto Rico and the U.S. Virgin Islands) are off. Switch DC on and the pool is 51; switch the territories on and it is 55; switch both on and it is 56. The stage header says which of them are on above every draw, so you are never guessing about what could have come out.
Can I draw a random state from one region?
Yes. The Pool control offers the four regions the Census Bureau publishes, with the size of each pool shown beside its name: Northeast 9, Midwest 12, South 16 and West 13, which is the whole 50. Two things follow from using the Bureau's definitions rather than inventing our own. The District of Columbia is counted in the South, so a South draw with DC switched on is 17 places. The territories belong to no region at all, so choosing a region draws from states alone even when the territories are on.
Can the same state come up twice?
Not with No repeats on, which is the default: the draw walks a shuffle, so each state that comes out is removed from that draw and the numbers under the list say how many are left. Asking for more than the pool holds is refused with both numbers rather than answered short, so 12 from the 9 states of the Northeast tells you the pool is 9. Turn No repeats off and each pick is an independent draw over the whole pool, which is how you get 12 from those same 9 states, and the line under the stage says repeats are allowed so the result is never a surprise.
Can I copy the list, with the state abbreviations?
Copy takes the whole draw in whichever of four shapes you pick: one name per line, one USPS postal code per line, the name and the code together as Oregon (OR), or the names on a single comma separated line. The stage shows the names and the codes in numbered columns whatever the copy setting is. If the browser refuses the clipboard, the tool says so and the list is on screen to select by hand rather than leaving a button that looks broken.
Is the draw actually random?
The index comes from crypto.getRandomValues, the browser's own cryptographic generator, and it is mapped onto the pool by rejection sampling rather than by a remainder. A remainder would hand the first few states in the list one extra chance each, because 2 to the power 32 is not a multiple of 50, so draws landing above the last whole multiple are thrown away and drawn again instead. Every state in the pool has the same chance on every draw. Nothing is uploaded and no account is needed: the draw happens in your tab and only your settings are kept, in this browser.

The default pool is exactly the 50 states and nothing else. The District of Columbia and the five territories are added only when you switch them on, which takes the pool to 56. A unique draw removes each state as it is picked, so the pool empties rather than repeating, and the randomness is your browser's crypto source.