We present formation simulations of the six Kepler 11 planets. Models assume either in situ or ex situ assembly, the latter with migration, and are evolved to the estimated age of the system, ≈ 8 Gyr. Models combine detailed calculations of both the gaseous envelope and the condensed core structures, including accretion of gas and solids, of the disk's viscous and thermal evolution, including photo-evaporation and disk-planet interactions, and of the planets' evaporative mass loss after disk dispersal. Planetplanet interactions are neglected. Both sets of simulations successfully reproduce measured radii, masses, and orbital distances of the planets, except for the radius of Kepler 11b, which loses its entire gaseous envelope shortly after formation. Gaseous (H+He) envelopes account for 18% of the planet masses, and between ≈ 35 and ≈ 60% of the planet radii. In situ models predict a very massive inner disk, whose solids' surface density (σ Z ) varies from over 10 4 to ≈ 10 3 g cm −2 at stellocentric distances 0.1 r 0.5 au. Initial gas densities would be in excess of 10 5 g cm −2 if solids formed locally. Given the high disk temperatures ( 1000 K), planetary interiors can only be composed of metals and highly refractory materials. Sequestration of hydrogen by the core and subsequent outgassing is required to account for the observed radius of Kepler 11b. Ex situ models predict a relatively low-mass disk, whose initial σ Z varies from ≈ 10 to ≈ 5 g cm −2 at 0.5 r 7 au and whose initial gas density ranges from ≈ 10 3 to ≈ 100 g cm −2 . All planetary interiors are expected to be rich in H 2 O, as core assembly mostly occurs exterior to the ice condensation front. Kepler 11b is expected to have a steam atmosphere, and H 2 O is likely mixed with H+He in the envelopes of the other planets. Results indicate that Kepler 11g may not be more massive than Kepler 11e.