Using the preset string
In Java Edition, choose Create New World, then More World Options (the World tab), set World Type to Superflat and press Customize, then Presets. Replace the text at the top with the string from this page and press Use Preset. The string lists the layers from the bottom up, each a block ID with a count in front when there is more than one (2*minecraft:dirt), then a semicolon and the biome.
Structures, decorations and lakes
The string only holds the layers and the biome. Which structures generate, and whether trees, ores and lakes appear, comes from the preset that was selected when you pasted it: click the built-in preset closest to what you want first (Overworld has the most), then replace its text. The World Type screen's Generate Structures switch turns them all off. A server reads everything from the generator-settings JSON, where the structures, decorations and lakes you tick here are written out in full.
Setting up a server
Copy the server.properties lines over the level-type and generator-settings lines in your server's file. They only take effect when a new world is made, so stop the server and either delete the world folder or set a new level-name before starting it again. The server may rewrite the line with backslashes before the colons; that is the same setting.
Height
Layers start at the bottom of the world, y −64, and the Overworld is 384 blocks tall, up to y 319. Layers that go past the top are cut off, and the preview warns you. The facts beside the preview say where the ground ends and the height you stand at. The Void is a single layer of air: the game places a small stone platform to spawn on.
The built-in presets
Checked against Java Edition 26.3. Water World was changed in 1.18.2 to sit deeper, on deepslate and gravel, and Redstone Ready has 116 layers of sandstone; older guides list the shorter versions from before the world grew to 384 blocks. Strings from before 1.13, which used numbers instead of names (3;7,2*3,2;1), are no longer read by the game.
Questions
What is the Classic Flat preset string?
minecraft:bedrock,2*minecraft:dirt,minecraft:grass_block;minecraft:plains: one layer of bedrock, two of dirt and one of grass, in plains, with villages.
Does a superflat world need bedrock at the bottom?
No. Bedrock stops you digging into the void, but any block can be the bottom layer. Bottomless Pit starts with cobblestone for exactly that reason: dig through it and you fall out of the world.
Can I use blocks like water or lava as a layer?
Yes, any block works, including water, lava, air and blocks that fall. Falling blocks such as sand stay put until something next to them changes.
Does it save anything?
No. The layers and settings are kept in the page's address, so Copy link shares the same world. Nothing is stored and nothing is sent anywhere.