Our brains efficiently filter and compress visual information about the world through a neural code which informs cognition and behavior. Despite decades of effort, this code remains elusive. To understand the neural code for visual recognition, we need to extract samples of this code directly from neurons, in the least biased and constrained way possible. I pioneered a new method to extract “codewords” directly from the living brain, in the form of images generated by a new type of artificial intelligence model. I will build on these findings to elucidate the origin and application of the code. We will sample the visual code from five brain regions to define how it changes on its path from sensation to cognition, build a novel framework for scientific interpretation, and finally show how the code interacts with behavior. By learning the brain’s code, we will inspire next-generation neural network models with myriad applications in medicine, communication, transportation, and more.