# Unit Cell & Crystal Structure Viewer - 3D Models, Atoms per Cell, Packing Efficiency, Density

> Interactive 3D unit cells (SC, BCC, FCC, HCP, NaCl, CsCl, ZnS, diamond, perovskite) with atoms per cell, coordination number, packing efficiency and density.

- URL: https://qilingtools.com/en/math/crystal
- Category: Math Tools (https://qilingtools.com/en/math)
- Tags: [Math](https://qilingtools.com/en/tags/math), [Chemistry](https://qilingtools.com/en/tags/chemistry), [Physics](https://qilingtools.com/en/tags/physics)
- Last updated: 2026-10-26
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

A unit cell is the smallest repeating block that builds a whole crystal. To count the atoms it contains, each atom is shared with neighbouring cells: in a cubic cell a corner atom counts ⅛, an edge atom ¼, a face atom ½ and an atom inside the cell 1. In rock salt, for example, Cl⁻ gives 8 × ⅛ + 6 × ½ = 4 and Na⁺ gives 12 × ¼ + 1 = 4, so the cell holds 4 NaCl formula units; corners of a hexagonal prism count ⅙. This tool covers 12 common structures: simple cubic, body-centred cubic, face-centred cubic (cubic close packing), hexagonal close packing, NaCl, CsCl, zinc blende (ZnS), fluorite (CaF₂), diamond, graphite, perovskite (CaTiO₃) and rutile (TiO₂). Drag the 3D model to rotate it, switch between whole atoms, shared fractions and unique atoms, scale the atoms up until the hard spheres touch, highlight the coordination polyhedron around a chosen atom or expand to 2×2×2 cells. Each structure lists the counting breakdown, coordination number, packing efficiency (74.05% for FCC and HCP, 68.02% for BCC, 52.36% for SC, 34.01% for diamond), the relation between edge a and radius r (FCC 4r = √2a, BCC 4r = √3a) and example substances. The density calculator solves ρ = Z·M / (N_A·a³) for density, lattice constant, radius, molar mass or Z; for copper (FCC, a = 361.5 pm) it gives ρ = 4 × 63.546 / (6.022 × 10²³ × (3.615 × 10⁻⁸ cm)³) ≈ 8.93 g/cm³. A radius ratio panel predicts the coordination number (3, 4, 6, 8) of ionic crystals from r₊/r₋.

## How to use

1. Pick a crystal structure and drag the 3D model to rotate it; switch to shared fractions, the coordination polyhedron or a 2×2×2 block
2. Read the atoms-per-cell breakdown, coordination number, packing efficiency and the a–r relation
3. Use the density calculator with a preset (Cu, Fe, NaCl, Si…) or your own data, choose what to solve for (ρ, a, r, M or Z), and try the radius ratio rule

## Features

- 12 structures: SC, BCC, FCC, HCP, NaCl, CsCl, ZnS, CaF₂, diamond, graphite, perovskite, rutile
- Rotatable 3D ball-and-stick / space-filling model with depth sorting and shading
- Shared-fraction view: corner ⅛, edge ¼, face ½, body 1, hexagonal prism corner ⅙
- Coordination polyhedron highlight with ghost atoms outside the cell
- Atom size slider up to true hard-sphere contact
- Packing efficiency, coordination number, a–r relation and examples for every structure
- Density calculator ρ = Z·M/(N_A·V) solving for ρ, a, r, M or Z; molar mass accepts a formula
- Radius ratio rule: r₊/r₋ → coordination number with the critical ratios derived

## FAQ

### How do you count the atoms in a unit cell?

Each atom is divided among the cells that share it. In a cubic cell a corner atom is shared by 8 cells (⅛ each), an edge atom by 4 (¼), a face atom by 2 (½) and an atom inside belongs entirely to the cell (1). FCC gives 8 × ⅛ + 6 × ½ = 4 atoms and BCC gives 8 × ⅛ + 1 = 2. In a hexagonal prism a corner is shared by 6 prisms, so HCP holds 12 × ⅙ + 2 × ½ + 3 = 6 atoms per prism (2 per primitive cell).

### What is the packing efficiency of FCC and BCC?

In FCC the atoms touch along the face diagonal, √2a = 4r, and the cell holds 4 atoms, so the packing efficiency is 4 × (4/3)πr³ / a³ = π/(3√2) ≈ 74.05%, the same as HCP and the maximum for equal spheres. In BCC they touch along the body diagonal, √3a = 4r, with 2 atoms, giving √3π/8 ≈ 68.02%. Simple cubic is 52.36% and diamond only 34.01%.

### How do I calculate density from the lattice constant?

Use ρ = Z·M / (N_A·V), where Z is the number of formula units per cell, M the molar mass and V the cell volume (a³ for a cubic cell, converting pm to cm with 1 pm = 10⁻¹⁰ cm). For copper, Z = 4 and a = 361.5 pm give ρ = 4 × 63.546 / (6.022 × 10²³ × 4.724 × 10⁻²³ cm³) ≈ 8.93 g/cm³. Rearranged, the same equation gives the lattice constant or atomic radius from a measured density.

### Is CsCl body-centred cubic?

No. In CsCl the Cl⁻ ions sit at the corners and the Cs⁺ ion at the body centre. Because the centre and the corners are different ions, the lattice is simple cubic with a two-ion basis (two interpenetrating simple cubic arrays), with 8 : 8 coordination. A structure is body-centred cubic only when the centre and corner atoms are identical, as in α-Fe or Na.

## Related tools

- [Graphing Calculator](https://qilingtools.com/en/math/graph): Free online function graphing calculator: type sin(x), x^2 or 1/x and see the curve at once, with several functions, parametric and polar curves, PNG export.
- [Scientific Calculator](https://qilingtools.com/en/math/calculator): Free online scientific calculator: type 2*(3+4)^2, sin(pi/6) or log(8,2) and see the answer as you type, with degrees or radians and a history list.
- [Equation Solver](https://qilingtools.com/en/math/equation): Free online equation solver: enter coefficients for linear, quadratic (with discriminant, vertex and complex roots) and cubic equations, plus 2×2 systems.
- [Fraction Calculator](https://qilingtools.com/en/math/fraction): Free online fraction calculator: add, subtract, multiply and divide fractions with automatic reduction, plus fraction ↔ decimal with repeating digits.
- [Percentage Calculator](https://qilingtools.com/en/math/percentage): Free online percentage calculator: X% of Y, X as a percent of Y, increase and decrease, a value after a percentage change and the original behind it.
- [Prime Factorization](https://qilingtools.com/en/math/prime): Free online prime factorization: factor an integer with exponents, list every divisor and their sum, test primality with neighbouring primes, or list a range.
- [GCD and LCM](https://qilingtools.com/en/math/gcd-lcm): Free online GCD and LCM calculator: works with two or more integers, says whether they are coprime, shows each prime factorization and every Euclidean step.
- [Statistics Calculator](https://qilingtools.com/en/math/statistics): Free online statistics calculator: paste a data set for the mean, median, mode, range, quartiles, variance, standard deviation, standard error and outliers.
