Skip to content

Instantly share code, notes, and snippets.

@mshafrir
Created May 9, 2012 17:05
Show Gist options
  • Save mshafrir/2646763 to your computer and use it in GitHub Desktop.
Save mshafrir/2646763 to your computer and use it in GitHub Desktop.
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
"DC": "District Of Columbia",
"FM": "Federated States Of Micronesia",
"FL": "Florida",
"GA": "Georgia",
"GU": "Guam",
"HI": "Hawaii",
"ID": "Idaho",
"IL": "Illinois",
"IN": "Indiana",
"IA": "Iowa",
"KS": "Kansas",
"KY": "Kentucky",
"LA": "Louisiana",
"ME": "Maine",
"MH": "Marshall Islands",
"MD": "Maryland",
"MA": "Massachusetts",
"MI": "Michigan",
"MN": "Minnesota",
"MS": "Mississippi",
"MO": "Missouri",
"MT": "Montana",
"NE": "Nebraska",
"NV": "Nevada",
"NH": "New Hampshire",
"NJ": "New Jersey",
"NM": "New Mexico",
"NY": "New York",
"NC": "North Carolina",
"ND": "North Dakota",
"MP": "Northern Mariana Islands",
"OH": "Ohio",
"OK": "Oklahoma",
"OR": "Oregon",
"PW": "Palau",
"PA": "Pennsylvania",
"PR": "Puerto Rico",
"RI": "Rhode Island",
"SC": "South Carolina",
"SD": "South Dakota",
"TN": "Tennessee",
"TX": "Texas",
"UT": "Utah",
"VT": "Vermont",
"VI": "Virgin Islands",
"VA": "Virginia",
"WA": "Washington",
"WV": "West Virginia",
"WI": "Wisconsin",
"WY": "Wyoming"
}
[
{
"name": "Alabama",
"abbreviation": "AL"
},
{
"name": "Alaska",
"abbreviation": "AK"
},
{
"name": "American Samoa",
"abbreviation": "AS"
},
{
"name": "Arizona",
"abbreviation": "AZ"
},
{
"name": "Arkansas",
"abbreviation": "AR"
},
{
"name": "California",
"abbreviation": "CA"
},
{
"name": "Colorado",
"abbreviation": "CO"
},
{
"name": "Connecticut",
"abbreviation": "CT"
},
{
"name": "Delaware",
"abbreviation": "DE"
},
{
"name": "District Of Columbia",
"abbreviation": "DC"
},
{
"name": "Federated States Of Micronesia",
"abbreviation": "FM"
},
{
"name": "Florida",
"abbreviation": "FL"
},
{
"name": "Georgia",
"abbreviation": "GA"
},
{
"name": "Guam",
"abbreviation": "GU"
},
{
"name": "Hawaii",
"abbreviation": "HI"
},
{
"name": "Idaho",
"abbreviation": "ID"
},
{
"name": "Illinois",
"abbreviation": "IL"
},
{
"name": "Indiana",
"abbreviation": "IN"
},
{
"name": "Iowa",
"abbreviation": "IA"
},
{
"name": "Kansas",
"abbreviation": "KS"
},
{
"name": "Kentucky",
"abbreviation": "KY"
},
{
"name": "Louisiana",
"abbreviation": "LA"
},
{
"name": "Maine",
"abbreviation": "ME"
},
{
"name": "Marshall Islands",
"abbreviation": "MH"
},
{
"name": "Maryland",
"abbreviation": "MD"
},
{
"name": "Massachusetts",
"abbreviation": "MA"
},
{
"name": "Michigan",
"abbreviation": "MI"
},
{
"name": "Minnesota",
"abbreviation": "MN"
},
{
"name": "Mississippi",
"abbreviation": "MS"
},
{
"name": "Missouri",
"abbreviation": "MO"
},
{
"name": "Montana",
"abbreviation": "MT"
},
{
"name": "Nebraska",
"abbreviation": "NE"
},
{
"name": "Nevada",
"abbreviation": "NV"
},
{
"name": "New Hampshire",
"abbreviation": "NH"
},
{
"name": "New Jersey",
"abbreviation": "NJ"
},
{
"name": "New Mexico",
"abbreviation": "NM"
},
{
"name": "New York",
"abbreviation": "NY"
},
{
"name": "North Carolina",
"abbreviation": "NC"
},
{
"name": "North Dakota",
"abbreviation": "ND"
},
{
"name": "Northern Mariana Islands",
"abbreviation": "MP"
},
{
"name": "Ohio",
"abbreviation": "OH"
},
{
"name": "Oklahoma",
"abbreviation": "OK"
},
{
"name": "Oregon",
"abbreviation": "OR"
},
{
"name": "Palau",
"abbreviation": "PW"
},
{
"name": "Pennsylvania",
"abbreviation": "PA"
},
{
"name": "Puerto Rico",
"abbreviation": "PR"
},
{
"name": "Rhode Island",
"abbreviation": "RI"
},
{
"name": "South Carolina",
"abbreviation": "SC"
},
{
"name": "South Dakota",
"abbreviation": "SD"
},
{
"name": "Tennessee",
"abbreviation": "TN"
},
{
"name": "Texas",
"abbreviation": "TX"
},
{
"name": "Utah",
"abbreviation": "UT"
},
{
"name": "Vermont",
"abbreviation": "VT"
},
{
"name": "Virgin Islands",
"abbreviation": "VI"
},
{
"name": "Virginia",
"abbreviation": "VA"
},
{
"name": "Washington",
"abbreviation": "WA"
},
{
"name": "West Virginia",
"abbreviation": "WV"
},
{
"name": "Wisconsin",
"abbreviation": "WI"
},
{
"name": "Wyoming",
"abbreviation": "WY"
}
]
@Qasim-bbits
Copy link

What is your use case as 13 states have multiple time zones?On Jan 5, 2023, at 6:20 AM, Qasim-bbits @.> wrote:Re: @. commented on this gist.Can anyone add time zones as well with states?—Reply to this email directly, view it on GitHub or unsubscribe.You are receiving this email because you commented on the thread.Triage notifications on the go with GitHub Mobile for iOS or Android.

There are 52 states and 6 time zones in US. One user is creating an event according to his time zone and other users can see that according to their time zones so I need to get user time zones according to his state.

@MountainJay
Copy link

I’m afraid ACPK is correct, timezones are quite a bit more complicated than you’re making it out to be.

If you take a peek into the IANA TZ database, you’ll see many, many timezones in play in the US alone. Not all of them are currently relevant (eg Indiana).

A breakdown of timezones by region worldwide can be seen here: http://efele.net/maps/tz/world/

Arizona, for instance, does not follow DST but the Navajo land inside of it does.

This also ignores the fact that many states have been trying to permanently set themselves to DST. This is much more likely to change in the near future than the US adding a new state, so caching such information in the same file could be problematic.

@zach-betz-hln
Copy link

zach-betz-hln commented Jan 10, 2023

Thank you for this @mshafrir

@Blackjacx
Copy link

Is this somewhere existing for the whole world?!

@Emmanuelhd
Copy link

Is this somewhere existing for the whole world?!

Yes, here.

@nanasnumber
Copy link

Looking for exactly this! Thank you @mshafrir

@evild70
Copy link

evild70 commented Sep 14, 2023

All lowercase. Spaces replaced with dashes.

{
  "al": "alabama",
  "ak": "alaska",
  "as": "american-samoa",
  "az": "arizona",
  "ar": "arkansas",
  "ca": "california",
  "co": "colorado",
  "ct": "connecticut",
  "de": "delaware",
  "dc": "district-of-columbia",
  "fm": "federated-states-of-micronesia",
  "fl": "florida",
  "ga": "georgia",
  "gu": "guam",
  "hi": "hawaii",
  "id": "idaho",
  "il": "illinois",
  "in": "indiana",
  "ia": "iowa",
  "ks": "kansas",
  "ky": "kentucky",
  "la": "louisiana",
  "me": "maine",
  "mh": "marshall-islands",
  "md": "maryland",
  "ma": "massachusetts",
  "mi": "michigan",
  "mn": "minnesota",
  "ms": "mississippi",
  "mo": "missouri",
  "mt": "montana",
  "ne": "nebraska",
  "nv": "nevada",
  "nh": "new-hampshire",
  "nj": "new-jersey",
  "nm": "new-mexico",
  "ny": "new-york",
  "nc": "north-carolina",
  "nd": "north-dakota",
  "mp": "northern-mariana-islands",
  "oh": "ohio",
  "ok": "oklahoma",
  "or": "oregon",
  "pw": "palau",
  "pa": "pennsylvania",
  "pr": "puerto-rico",
  "ri": "rhode-island",
  "sc": "south-carolina",
  "sd": "south-dakota",
  "tn": "tennessee",
  "tx": "texas",
  "ut": "utah",
  "vt": "vermont",
  "vi": "virgin-islands",
  "va": "virginia",
  "wa": "washington",
  "wv": "west-virginia",
  "wi": "wisconsin",
  "wy": "wyoming"
}

@kilonzi
Copy link

kilonzi commented Oct 14, 2023

inspired by @WHITEH0ST to include full names for Django Choicefield: -

US_STATES = (
    ('Select one', 'Select one'), 
    ('AL', 'Alabama'),
    ('AK', 'Alaska'),
    ('AZ', 'Arizona'),
    ('AR', 'Arkansas'),
    ('AS', 'American Samoa'),
    ('CA', 'California'),
    ('CO', 'Colorado'),
    ('CT', 'Connecticut'),
    ('DE', 'Delaware'),
    ('DC', 'District Of Columbia'),
    ('FM', 'Federated States Of Micronesia'),
    ('FL', 'Florida'),
    ('GA', 'Georgia'),
    ('GU', 'Guam'),
    ('HI', 'Hawaii'),
    ('ID', 'Idaho'),
    ('IL', 'Illinois'),
    ('IN', 'Indiana'),
    ('IA', 'Iowa'),
    ('KS', 'Kansas'),
    ('KY', 'Kentucky'),
    ('LA', 'Louisiana'),
    ('ME', 'Maine'),
    ('MH', 'Marshall Islands'),
    ('MD', 'Maryland'),
    ('MA', 'Massachusetts'),
    ('MI', 'Michigan'),
    ('MN', 'Minnesota'),
    ('MS', 'Mississippi'),
    ('MO', 'Missouri'),
    ('MT', 'Montana'),
    ('NE', 'Nebraska'),
    ('NV', 'Nevada'),
    ('NH', 'New Hampshire'),
    ('NJ', 'New Jersey'),
    ('NM', 'New Mexico'),
    ('NY', 'New York'),
    ('NC', 'North Carolina'),
    ('ND', 'North Dakota'),
    ('MP', 'Northern Mariana Islands'),
    ('OH', 'Ohio'),
    ('OK', 'Oklahoma'),
    ('OR', 'Oregon'),
    ('PW', 'Palau'),
    ('PA', 'Pennsylvania'),
    ('PR', 'Puerto Rico'),
    ('RI', 'Rhode Island'),
    ('SC', 'South Carolina'),
    ('SD', 'South Dakota'),
    ('TN', 'Tennessee'),
    ('TX', 'Texas'),
    ('UT', 'Utah'),
    ('VT', 'Vermont'),
    ('VI', 'Virgin Islands'),
    ('VA', 'Virginia'),
    ('WA', 'Washington'),
    ('WV', 'West Virginia'),
    ('WI', 'Wisconsin'),
    ('WY', 'Wyoming')
)

@kuzmicheff
Copy link

Thank you very much for sharing!

@HamzaFa61
Copy link

Thank you for sharing! Do anyone have an idea where I can find the associated cities list?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment