A nociceptor (from Latin  nocere 'to harm or hurt'; lit. 'pain receptor') is a sensory neuron that responds to damaging or potentially damaging stimuli by sending "possible threat" signals to the spinal cord and the brain. The brain creates the sensation of pain to direct attention to the body part, so the threat can be mitigated; this process is called nociception.
 Nociceptors were discovered by Charles Scott Sherrington in 1906. In earlier centuries, scientists believed that animals were like mechanical devices that transformed the energy of sensory stimuli into motor responses. Sherrington used many different experiments to demonstrate that different types of stimulation to an afferent nerve fiber's receptive field led to different responses. Some intense stimuli trigger reflex withdrawal, certain autonomic responses, and pain. The specific receptors for these intense stimuli were called nociceptors.
 In mammals, nociceptors are found in any area of the body that can sense noxious stimuli.   External nociceptors are found in tissue such as the skin (cutaneous nociceptors), the corneas, and the mucosa. Internal nociceptors are found in a variety of organs, such as the muscles, the joints, the bladder, the visceral organs, and the digestive tract. The cell bodies of these neurons are located in either the dorsal root ganglia or the trigeminal ganglia. The trigeminal ganglia are specialized nerves for the face, whereas the dorsal root ganglia are associated with the rest of the body. The axons extend into the peripheral nervous system and terminate in branches to form receptive fields.
 Nociceptors develop from neural-crest stem cells. The neural crest is responsible for a large part of early development in vertebrates.  It is specifically responsible for development of the peripheral nervous system (PNS). The neural-crest stem cells split from the neural tube as it closes, and nociceptors grow from the dorsal part of this neural-crest tissue. They form late during neurogenesis. Earlier forming cells from this region can become non-pain sensing receptors, either proprioceptors or low-threshold mechanoreceptors. All neurons derived from the neural crest, including embryonic nociceptors, express the tropomyosin receptor kinase A (TrkA), which is a receptor to nerve growth factor (NGF). However, transcription factors that determine the type of nociceptor remain unclear.
 Following sensory neurogenesis, differentiation occurs, and two types of nociceptors are formed. They are classified as either peptidergic or nonpeptidergic nociceptors, each of which express a distinct repertoire of ion channels and receptors.  Their specializations allow the receptors to innervate different central and peripheral targets. This differentiation occurs in both perinatal and postnatal periods. The nonpeptidergic nociceptors switch off the TrkA and begin expressing RET proto-oncogene, which is a transmembrane signaling component that allows the expression of glial cell line-derived neurotrophic factor (GDNF). This transition is assisted by runt-related transcription factor 1 (RUNX1) which is vital in the development of nonpeptidergic nociceptors. On the contrary, the peptidergic nociceptors continue to use TrkA, and they express a completely different type of growth factor.  There currently is a lot of research about the differences between nociceptors.
 The peripheral terminal of the mature nociceptor is where the noxious stimuli are detected and transduced into electrical energy. When the electrical energy reaches a threshold value, an action potential is induced and driven towards the central nervous system (CNS). This leads to the train of events that allows for the conscious awareness of pain. The sensory specificity of nociceptors is established by the high threshold only to particular features of stimuli. Only when the high threshold has been reached by either chemical, thermal, or mechanical environments are the nociceptors triggered. The majority of nociceptors are classified by which of the environmental modalities they respond to. Some nociceptors respond to more than one of these modalities and are consequently designated polymodal. Other nociceptors respond to none of these modalities (although they may respond to stimulation under conditions of inflammation) and are referred to as sleeping or silent.
 Nociceptors have two different types of axons. The first are the Aδ fiber axons. They are myelinated and can allow an action potential to travel at a rate of about 20 meters/second towards the CNS. The other type is the more slowly conducting C fiber axons. These only conduct at speeds of around 2 meters/second. This is due to the light or non-myelination of the axon. As a result, pain comes in two phases. The first phase is mediated by the fast-conducting Aδ fibers and the second part due to (Polymodal) C fibers. The pain associated with the Aδ fibers can be associated to an initial extremely sharp pain. The second phase is a more prolonged and slightly less intense feeling of pain as a result of the acute damage. If there is massive or prolonged input to a C fiber, there is a progressive build up in the spinal cord dorsal horn; this phenomenon is similar to tetanus in muscles but is called wind-up. If wind-up occurs there is a probability of increased sensitivity to pain.
 Thermal nociceptors are activated by noxious heat or cold at various temperatures. There are specific nociceptor transducers that are responsible for how and if the specific nerve ending responds to the thermal stimulus. The first to be discovered was TRPV1, and it has a threshold that coincides with the heat pain temperature of 43 °C. Other temperature in the warm–hot range is mediated by more than one TRP channel. Each of these channels express a particular C-terminal domain that corresponds to the warm–hot sensitivity. The interactions between all these channels and how the temperature level is determined to be above the pain threshold are unknown at this time. The cool stimuli are sensed by TRPM8 channels. Its C-terminal domain differs from the heat sensitive TRPs. Although this channel corresponds to cool stimuli, it is still unknown whether it also contributes in the detection of intense cold. An interesting finding related to cold stimuli is that tactile sensibility and motor function deteriorate while pain perception persists.
 Mechanical nociceptors respond to excess pressure or mechanical deformation. They also respond to incisions that break the skin surface. The reaction to the stimulus is processed as pain by the cortex, just like chemical and thermal responses. These mechanical nociceptors frequently have polymodal characteristics. So it is possible that some of the transducers for thermal stimuli are the same for mechanical stimuli. The same is true for chemical stimuli, since TRPA1 appears to detect both mechanical and chemical changes. Some mechanical stimuli can cause release of intermediate chemicals, such as ATP, which can be detected by P2 purinergic receptors, or nerve growth factor, which can be detected by Tropomyosin receptor kinase A (TrkA).
 Chemical nociceptors have TRP channels that respond to a wide variety of spices. The one that sees the most response and is very widely tested is capsaicin. Other chemical stimulants are environmental irritants like acrolein, a World War I chemical weapon and a component of cigarette smoke. Apart from these external stimulants, chemical nociceptors have the capacity to detect endogenous ligands, and certain fatty acid amines that arise from changes in internal tissues. Like in thermal nociceptors, TRPV1 can detect chemicals like capsaicin and spider toxins and acids. Acid-sensing ion channels (ASIC) also detect acidity.
 Although each nociceptor can have a variety of possible threshold levels, some do not respond at all to chemical, thermal or mechanical stimuli unless injury actually has occurred. These are typically referred to as silent or sleeping nociceptors since their response comes only on the onset of inflammation to the surrounding tissue.
 Many neurons perform only a single function; therefore, neurons that perform these functions in combination are given the classification "polymodal."
 
 Afferent nociceptive fibers (those that send information to, rather than from the brain) travel back to the spinal cord where they form synapses in its dorsal horn. This nociceptive fiber (located in the periphery) is a first order neuron. The cells in the dorsal horn are divided into physiologically distinct layers called laminae. Different fiber types form synapses in different layers, and use either glutamate or substance P as the neurotransmitter. Aδ fibers form synapses in laminae I and V, C fibers connect with neurons in lamina II, Aβ fibers connect with lamina I, III, & V.  After reaching the specific lamina within the spinal cord, the first order nociceptive project to second order neurons that cross the midline at the anterior white commissure. The second order neurons then send their information via two pathways to the thalamus: the dorsal column medial-lemniscal system and the anterolateral system. The former is reserved more for regular non-painful sensation, while the latter is reserved for pain sensation. Upon reaching the thalamus, the information is processed in the ventral posterior nucleus and sent to the cerebral cortex in the brain via fibers in the posterior limb of the internal capsule.
 As there is an ascending pathway to the brain that initiates the conscious realization of pain, there also is a descending pathway which modulates pain sensation. The brain can request the release of specific hormones or chemicals that can have analgesic effects which can reduce or inhibit pain sensation. The area of the brain that stimulates the release of these hormones is the hypothalamus. This effect of descending inhibition can be shown by electrically stimulating the periaqueductal grey area of the midbrain or the periventricular nucleus. They both in turn project to other areas involved in pain regulation, such as the nucleus raphe magnus which also receives similar afferents from the nucleus reticularis paragigantocellularis (NPG). In turn the nucleus raphe magnus projects to the substantia gelatinosa region of the dorsal horn and mediates the sensation of spinothalamic inputs. This is done first by the nucleus raphe magnus sending serotoninergic neurons to neurons in the dorsal cord, that in turn secrete enkephalin to the interneurons that carry pain perception. Enkephalin functions by binding opioid receptors to cause inhibition of the post-synaptic neuron, thus inhibiting pain. The periaqueductal grey also contains opioid receptors which explains one of the mechanisms by which opioids such as morphine and diacetylmorphine exhibit an analgesic effect.
 Nociceptor neuron sensitivity is modulated by a large variety of mediators in the extracellular space. Peripheral sensitization represents a form of functional plasticity of the nociceptor. The nociceptor can change from being simply a noxious stimulus detector to a detector of non-noxious stimuli. The result is that low intensity stimuli from regular activity, initiates a painful sensation. This is commonly known as hyperalgesia. Inflammation is one common cause that results in the sensitization of nociceptors. Normally hyperalgesia ceases when inflammation goes down, however, sometimes genetic defects and/or repeated injury can result in allodynia: a completely non-noxious stimulus like light touch causes extreme pain. Allodynia can also be caused when a nociceptor is damaged in the peripheral nerves. This can result in deafferentation, which means the development of different central processes from the surviving afferent nerve. With this situation, surviving dorsal root axons of the nociceptors can make contact with the spinal cord, thus changing the normal input.
 Nociception has been documented in non-mammalian animals, including fish and a wide range of invertebrates, including leeches, nematode worms, sea slugs, and larval fruit flies. Although these neurons may have pathways and relationships to the central nervous system that are different from those of mammalian nociceptors, nociceptive neurons in non-mammals often fire in response to similar stimuli as mammals, such as high temperature (40 degrees C or more), low pH, capsaicin, and tissue damage.
 Due to a historical misunderstanding of pain, nociceptors are also inappropriately referred to as pain receptors. Although all pain is real, psychological factors can strongly influence subjective intensity and the threshold of pain for each person.