Compact bone is the dense, hard outer layer of bone that gives strength and shape. It forms the cortex of bones, resists bending, and protects the spongy bone inside.