By Tim King · Updated
Crystal Lattice Viewer
3D Unit Cells (SC, BCC, FCC, HCP, Diamond, NaCl), Free
OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.
How the Crystal Lattice Viewer works
This crystal lattice viewer shows unit cells in 3D. Pick a crystal structure and orbit its unit cell in 3D: the simple, body-centred and face-centred cubic metals, hexagonal close packing, diamond, and the ionic rock salt, caesium chloride, zinc blende and perovskite arrangements. Stack up to four cells per side to see the extended lattice, slide the atom size from small balls to touching spheres, switch the cell edges and nearest-neighbour bonds on or off, and read the atoms per cell, coordination number and packing fraction in the rail. Download a PNG for notes or a slide.
Crystal lattice viewer: the structures
Simple cubic puts an atom at each corner of a cube, which only polonium adopts because it wastes so much space. Body-centred cubic adds one in the middle, the structure of iron at room temperature, chromium and tungsten. Face-centred cubic adds an atom to each face instead and is the densest cubic packing, shared by copper, aluminium, gold, silver and nickel. Hexagonal close packing reaches the same density with a different stacking order (ABAB rather than ABCABC) and is the structure of magnesium, zinc and titanium; its cell is a rhombic prism rather than a cube, so the edges here are drawn on that shape. Diamond is face-centred cubic with a second, offset copy interleaved, giving each carbon or silicon atom four neighbours in a tetrahedron. The ionic structures place two or three species on separate sublattices: sodium and chloride ions each on their own face-centred lattice in rock salt, one of each in the cube for caesium chloride, the diamond arrangement with alternating elements in zinc blende, and the corner, body and face positions of perovskite filled by three different ions.
Reading the numbers
Atoms per cell counts the fractions: a corner atom is shared by eight cells and a face atom by two, so face-centred cubic has 8 × ⅛ + 6 × ½ = 4 atoms per cell. Coordination is the number of nearest neighbours around an atom, which is what the bonds drawn in the viewport join. The packing fraction is the share of the cell volume filled by touching spheres: 52 percent for simple cubic, 68 for body-centred, 74 for both close-packed structures and only 34 for diamond. For ionic structures the fraction depends on the two ion radii so it is not quoted, but the radius relation line gives the geometry that sets the lattice constant, for example a = 2(r₊ + r₋) in rock salt where cation and anion touch along a cell edge.
Atom size and bonds
At 100 percent the spheres are drawn at the radius where nearest neighbours touch, which shows how the structure packs and where the interstitial holes are; for ionic cells the two radii are in the ratio of the real ions. Smaller sizes turn the model into a ball-and-stick diagram where the geometry is easier to see. Bonds join every pair of nearest neighbours in the drawn block; in ionic structures only cation–anion pairs are joined, which makes the six-fold octahedra of rock salt and the four-fold tetrahedra of zinc blende stand out.
Repeats and edges
With one cell you see the textbook unit cell, including the atoms on all of its corners and faces even though most of each belongs to a neighbouring cell. Two to four repeats show how the cells tile into a lattice and make close-packed planes visible when you orbit to look along a body diagonal. Cell edges can be hidden for a cleaner picture of the packing alone.
FAQ
Why does the single cell show more atoms than the atoms-per-cell figure?
The viewer draws every atom that touches the cell, including all eight corners and all six face centres, because that is how the structure is pictured in textbooks. The atoms-per-cell figure counts only the fraction of each that lies inside: an FCC cell shows 14 spheres but contains four atoms' worth of volume.
Which structures have the same packing fraction?
Face-centred cubic and hexagonal close packing both reach 74 percent, the maximum possible for equal spheres. They differ only in how the close-packed layers are stacked, which is why many metals switch between the two with temperature or pressure. Body-centred cubic is 68 percent and simple cubic 52.
Are the ion sizes in the ionic structures real?
They follow the standard ionic radii, scaled so that the touching pair sets the lattice constant: Na⁺ 1.02 Å and Cl⁻ 1.81 Å in rock salt, Cs⁺ 1.67 Å in caesium chloride, Zn²⁺ 0.74 Å and S²⁻ 1.84 Å in zinc blende. At 100 percent atom size you can see the anions nearly touching each other in rock salt, which is what limits how small a cation the structure can hold.
Can I load my own crystal from a CIF file?
Not here; this page is the set of textbook structures. The Molecule Viewer on this site opens PDB and XYZ files, so a CIF converted to XYZ with Open Babel, VESTA or ASE, with the cell repeated as many times as you want, will display there.
Why does the hexagonal cell look like a slanted box?
Hexagonal close packing is described by a cell with two edges of length a at 120 degrees and a vertical edge c of about 1.633a, so its outline is a rhombic prism rather than a cube. Three of them side by side form the hexagonal prism drawn in many textbooks; set repeats to three and look down the vertical axis to see it.
See also: all 3D Science tools, Images, Audio, Video & Screen, PDF, SVG, Simulations & Screensavers, Generative Art, Chart Makers, 3D Model Viewers, Drawing Pads, Mockups & 3D Making, Diagram Makers, Tracker Music.
Related tools
Molecule Viewer
Open a PDB or XYZ molecule in 3D, orbit it, save a PNG.
3D Function Plotter
Type z = f(x, y) and orbit the surface it makes.
Solar System Simulator
3D planets in their real positions for any date, with orbits and time control.
Rubik's Cube Solver
3D Rubik's cube that plays moves and solves any state.
Voxel Art Editor
Click blocks into a 3D voxel model and export OBJ or PLY.