List of fictional city-states in literature
This is a list of fictional city-states in literature. A city-state is a sovereign state that consists of a city and its dependent territories. They have been an important aspect of human society, and historically included famous cities like Athens, Carthage, Rome, and the Italian city-states of the Renaissance. Correspondingly in literature, there are numerous examples of fictional city-states. A-I 

 Academy City, also known as Gakuen Toshi is a landlocked sovereign city-state within the Tokyo Metropolitan Area. It is the main setting of the Japanese light novel series A Certain Magical Index and A Certain Scientific Railgun. Amber, a castle and city in The Chronicles of Amber, a series by Roger Zelazny. Ankh-Morpork, which features prominently in the Discworld series by Terry Pratchett. Aramanth, a city where personal freedoms don’t exist and success depends solely on performance in compulsory examinations, in the Wind on Fire trilogy by William Nicholson. Besźel, one of the eponymous twinned city-states in China Miéville's novel The City & the City. Braavos, Pentos, and other Free Cities from the A Song of Ice and Fire book series by George R. R. Martin. Caprona, a sovereign city-state in the world of the Chronicles of Chrestomanci series by Diana Wynne Jones. It is the setting for The Magicians of Caprona. Cities in Flight by James Blish are Earth cities which though the invention of the Spindizzy are able to take off into space, leaving an impoverished Earth behind, and wander the galaxy as independent "okie" cities. Columbia (Bioshock: Infinite)
 Cynosure (First Comics multiverse)
 Diaspar in The City and the Stars by Arthur C. Clarke
 Duchy of Grand Fenwick in The Mouse that Roared by Leonard Wibberley
 Dungeons & Dragons campaigns
 Free City of Greyhawk
 Menzoberranzan (Forgotten Realms)
 Neverwinter (Forgotten Realms)
 Sigil (Planescape)
 Waterdeep (Forgotten Realms)
 Kharé, Port Blacksand (Fighting Fantasy series by Steve Jackson)
 Esgaroth (Laketown), Lonely Mountain (The Hobbit by J.R.R. Tolkien) 
 Hav (Last Letters from Hav by Jan Morris, 1985)

J-R 

 Judge Dredd comic book series
 Brit-Cit
 Ciudad Baranquilla
 Hondo City
 Mega-City One
 Mega-City Two
 Lys in The City and the Stars by Arthur C. Clarke
 New Crobuzon (Books by China Miéville)
 New New York (The novel Do Androids Dream of Electric Sheep? by Philip K. Dick, Worlds trilogy by Joe Haldeman)
 Neustern, autonomous coastal city state invented in the paintings of artist Gary Farrelly. Solymbria, Boaktis, Tarxia, Zolon, Ir, Metouro, Govannion, Alissar, Xylar, Othomae, Kortoli, and Vindium  (all sharing a common language and culture but jealous of their independence and greatly differing in their systems of government; also, Iraz - a distant, non-Novarian city state in the same world, with a different language and culture Novarian series by L. Sprague de Camp: 
 Orsenna (fictional city in The Opposing Shore by Julien Gracq)
 Opar ("Lost" city in the African jungles, in the Tarzan books of Edgar Rice Burroughs, its ancient days of glory described in prequel series by Philip José Farmer)
 Pseudopolis, city-state on the Sto Plains in the Discworld series. The Riftwar Cycle by Raymond E. Feist
 The Free Cities of Natal on the continent of Triagia on Midkemia
 Krondor, a principality

S-Z 

 Actual Sitka, AK, USA with a fictional population in the millions and the host of a 1977 world fair, in Michael Chabon's alternate history detective novel "The Yiddish Policemen's Union"
The Begum's Fortune by Jules Verne
Stahlstadt (Steel City), a totalitarian German-speaking city-state
Ville-France, a utopian French-speaking city-state
 Superbia, (mobile city-state in the DC Comics universe)
 Three Portlands, an extradimensional city-state accessible via portals in Portland, Oregon, Portland, Maine, and the Isle of Portland. (SCP Foundation website)
 Ul Qoma, one of the eponymous twinned city-states in China Miéville's novel The City & the City
 Umbar (from The Lord of the Rings by J.R.R. Tolkien)
 The Vesani Republic from The Folding Knife by K.J. Parker
 Ys (from John Brunner's Traveller in Black)

References 

 
Lists of fictional populated places
City states