ICD-10 Code for Insomnia: Complete Guide to G47.00, F51.01 & Related Diagnosis Codes

ICD-10 Code for Insomnia_ G47.00, F51.01 & Complete Guide

Choosing the correct ICD-10 code for insomnia is essential for accurate diagnosis, medical documentation, insurance reimbursement, and effective patient care. While G47.00 (Insomnia, unspecified) is the most commonly reported diagnosis code, it isn’t always the right choice. Depending on the underlying cause, providers may need to assign codes such as G47.01, G47.09, or F51.01 and other related diagnoses. 

In this article, you’ll learn the complete list of insomnia ICD-10 codes, understand when each code should be used, discover the differences between the G47 and F51 code families, and find answers to common coding questions about chronic insomnia, acute insomnia, sleep disturbance, insomnia due to anxiety, pain, mental disorders, and more.

What Is the ICD-10 Code for Insomnia?

The ICD-10 code for insomnia depends on the type and underlying cause of the sleep disorder. However, the most commonly used diagnosis code is G47.00 (Insomnia, Unspecified). This billable ICD-10-CM code is assigned when a healthcare provider diagnoses insomnia, but the medical documentation does not specify its exact type or cause.

Insomnia can also be linked to a medical condition, mental disorder, or other specific factors, in which case a different ICD-10 code may be more appropriate. Selecting the correct code is essential for accurate clinical documentation, insurance reimbursement, and effective treatment planning.

G47.00 Explained: Insomnia, Unspecified

G47.00 is the most frequently reported ICD-10-CM code for insomnia. It represents Insomnia, Unspecified, meaning the patient has difficulty falling asleep, staying asleep, or achieving restorative sleep, but the medical record does not identify a specific cause or subtype.

Healthcare providers typically assign G47.00 when:

  • The patient is diagnosed with insomnia.
  • The underlying cause has not yet been determined.
  • Documentation lacks sufficient detail to support a more specific insomnia diagnosis.

Example

A patient complains of persistent difficulty sleeping for several weeks. After evaluation, the physician documents only “insomnia” without identifying whether it is primary, secondary, or related to another medical or psychiatric condition. In this case, G47.00 is the appropriate diagnosis code.

Although G47.00 is valid for billing, providers should document the underlying cause whenever possible, as greater specificity improves coding accuracy and supports appropriate patient care.

Complete List of Insomnia ICD-10 Codes

Insomnia is classified under multiple ICD-10-CM codes depending on its cause and clinical presentation. Understanding the differences between these codes helps ensure accurate diagnosis and reimbursement.

ICD-10-CM CodeDescriptionTypical Clinical Use
G47.00Insomnia, unspecifiedCause not documented
G47.01Insomnia due to medical conditionCaused by chronic illness, pain, neurological disorders, etc.
G47.09Other insomniaOther specified forms of insomnia
F51.01Primary (Nonorganic) insomniaNo identifiable medical cause
F51.02Adjustment insomniaShort-term insomnia following a stressful event
F51.04Psychophysiologic insomniaBehavioral or conditioned insomnia
F51.05Insomnia due to another mental disorderAssociated with depression, anxiety, PTSD, or other psychiatric conditions

Each code has its own documentation requirements, making it important to review the patient’s medical history and provider notes before assigning a diagnosis code.

G47 vs. F51: What’s the Difference?

One of the most common coding questions is whether to use a G47 code or an F51 code for insomnia. The answer depends on the underlying cause documented by the healthcare provider.

G47 Code FamilyF51 Code Family
Classified under diseases of the nervous systemClassified under mental, behavioral, and neurodevelopmental disorders
Used when insomnia is physiological or related to a medical conditionUsed when insomnia is considered nonorganic or associated with mental or behavioral factors
Includes codes such as G47.00, G47.01, and G47.09Includes codes such as F51.01, F51.02, F51.04, and F51.05

In general:

  • Choose a G47 code when insomnia is unspecified or linked to a medical condition.
  • Choose an F51 code when the provider documents a nonorganic, behavioral, or mental health-related cause for the insomnia.

Correctly distinguishing between these two code families helps reduce coding errors, supports accurate reimbursement, and ensures the patient’s medical record reflects the underlying cause of the sleep disorder.

Chronic Insomnia ICD-10 Code

Many healthcare providers and medical coders search for a dedicated chronic insomnia ICD-10 code, but ICD-10-CM does not assign a unique diagnosis code solely based on the duration of insomnia. Instead, the correct code depends on the documented cause of the condition.

For example:

  • G47.00: When chronic insomnia is documented but no specific cause is identified.
  • F51.01: When the provider diagnoses primary (nonorganic) insomnia.
  • F51.04: When chronic insomnia is classified as psychophysiologic insomnia.
  • G47.01: When insomnia is caused by an underlying medical condition.

Simply describing insomnia as “chronic” does not determine the diagnosis code. The provider must document whether the insomnia is primary, secondary, medical, behavioral, or psychiatric in origin.

Coding Tip

If the documentation only states “chronic insomnia” without additional details, avoid assuming the cause. Assign the code that best matches the provider’s documentation and follow official ICD-10-CM coding guidelines.

Acute Insomnia ICD-10 Code

Like chronic insomnia, there is no separate ICD-10-CM code specifically for acute insomnia. The diagnosis code depends on why the patient is experiencing temporary sleep difficulties.

Common coding scenarios include:

Clinical ScenarioPossible ICD-10-CM Code
Temporary insomnia after a stressful life eventF51.02 – Adjustment insomnia
Acute insomnia without a documented causeG47.00 – Insomnia, unspecified
Temporary insomnia caused by a medical illnessG47.01 – Insomnia due to a medical condition

Acute insomnia generally lasts for a short period, often a few days or weeks, and may resolve once the underlying trigger has been addressed. Accurate provider documentation is essential for selecting the most appropriate diagnosis code.

Primary Insomnia ICD-10 Code

The correct primary insomnia ICD-10 code is F51.01 – Primary Insomnia. This diagnosis is used when insomnia is not caused by another medical condition, psychiatric disorder, medication, or substance use.

Primary insomnia is often referred to as nonorganic insomnia because there is no identifiable physical cause for the patient’s sleep difficulties.

When to Use F51.01?

Assign F51.01 when the provider documents that the patient has:

  • Primary insomnia
  • Idiopathic insomnia
  • Nonorganic insomnia
  • Long-term difficulty initiating or maintaining sleep without an identifiable medical cause

When Not to Use F51.01?

Avoid using F51.01 if the insomnia is clearly caused by:

  • Chronic pain
  • Neurological disorders
  • Anxiety or depression
  • Medication side effects
  • Other underlying medical conditions

In these situations, another ICD-10-CM code may be more appropriate.

Persistent Insomnia ICD-10 Code

“Persistent insomnia” is another commonly used clinical term that does not have its own unique ICD-10-CM diagnosis code. Similar to chronic insomnia, coding depends on the documented etiology rather than the duration of symptoms.

Possible diagnosis codes include:

  • G47.00: Insomnia, unspecified
  • F51.01: Primary insomnia
  • F51.04: Psychophysiologic insomnia
  • G47.01: Insomnia due to a medical condition

The key consideration is identifying why the patient has persistent insomnia rather than how long it has lasted.

Documentation Matters

Providers should clearly document:

  • The underlying cause of insomnia
  • Whether it is primary or secondary
  • Any associated medical or psychiatric conditions
  • Clinical findings supporting the diagnosis

Detailed documentation improves coding accuracy and helps avoid claim denials.

ICD-10 Code for Sleep Disturbance

Many people use the terms sleep disturbance and insomnia interchangeably, but they are not always the same. Sleep disturbance is a broader term that includes many different sleep-related disorders, while insomnia specifically refers to difficulty falling asleep, staying asleep, or obtaining restorative sleep.

When documentation states only “sleep disturbance,” coders should review the medical record carefully before assigning an insomnia diagnosis code.

Common Sleep Disturbance Coding Scenarios

Clinical DocumentationPossible ICD-10-CM Code
Unspecified insomniaG47.00
Insomnia due to a medical conditionG47.01
Other specified insomniaG47.09
Primary (nonorganic) insomniaF51.01
Sleep disturbance caused by another sleep disorderCode according to the documented diagnosis

Healthcare providers should avoid coding sleep disturbance as insomnia unless the documentation specifically supports that diagnosis. If another sleep disorder—such as sleep apnea, hypersomnia, or circadian rhythm disorder—is documented, the diagnosis should be coded accordingly rather than defaulting to an insomnia code.

ICD-10 Code for Insomnia Due to Other Mental Disorder

When a healthcare provider documents that insomnia is caused by another mental disorder, the appropriate diagnosis is typically F51.05 – Insomnia Due to Other Mental Disorder.

This code is used when the patient’s sleep difficulties are directly linked to a diagnosed psychiatric condition rather than a physical illness or primary sleep disorder.

Common Conditions Associated with F51.05

Healthcare providers may assign F51.05 when insomnia is related to conditions such as:

  • Major depressive disorder
  • Generalized anxiety disorder
  • Post-traumatic stress disorder (PTSD)
  • Bipolar disorder
  • Obsessive-compulsive disorder (OCD)
  • Other documented mental health disorders

In most cases, the underlying mental disorder should also be coded separately to provide a complete clinical picture.

Coding Tip

Do not assign F51.05 solely because a patient reports stress or anxiety symptoms. The provider must clearly document that the insomnia is due to another diagnosed mental disorder before using this code.

ICD-10 Code for Insomnia Due to Stress and Anxiety

There is no single ICD-10-CM code specifically named “insomnia due to stress and anxiety.” The correct diagnosis depends on the provider’s documentation and the underlying cause of the patient’s sleep disturbance.

The most common coding scenarios include:

Clinical DocumentationPossible ICD-10-CM Code
Temporary insomnia following a stressful eventF51.02 – Adjustment Insomnia
Insomnia caused by a diagnosed anxiety disorder or another mental disorderF51.05 – Insomnia Due to Other Mental Disorder
Cause not clearly documentedG47.00 – Insomnia, Unspecified

For example, if a patient develops short-term insomnia after losing a job or experiencing a significant life change, F51.02 may be appropriate. However, if the provider documents that insomnia is secondary to generalized anxiety disorder or depression, F51.05 is generally the correct choice.

Proper documentation is essential to distinguish temporary stress-related insomnia from insomnia caused by a diagnosable psychiatric condition.

ICD-10 Code for Insomnia Due to Pain

Patients with chronic pain frequently experience difficulty sleeping. When the provider documents that insomnia is caused by an underlying medical condition, including chronic pain, the appropriate diagnosis is generally G47.01 Insomnia Due to a Medical Condition.

Examples include insomnia associated with:

  • Chronic back pain
  • Arthritis
  • Fibromyalgia
  • Cancer-related pain
  • Migraine disorders
  • Neuropathic pain
  • Other chronic medical illnesses

Important Coding Consideration

When using G47.01, the underlying medical condition responsible for the pain should also be coded. This ensures complete clinical documentation and accurately reflects the patient’s health status.

For example:

  • Chronic low back pain → Code the underlying back condition.
  • Insomnia resulting from that condition → G47.01

Coding both diagnoses provides a clearer explanation of the patient’s condition and supports appropriate reimbursement.

F Code for Insomnia: Understanding the F51 Series

One of the most common questions among coders is, “What is the F code for insomnia?” The answer depends on the type of insomnia documented by the provider.

The F51 category covers nonorganic sleep disorders, meaning the insomnia is behavioral, psychological, or associated with a mental disorder rather than a physical illness.

Common F51 Insomnia Codes

ICD-10-CM CodeDescription
F51.01Primary (Nonorganic) Insomnia
F51.02Adjustment Insomnia
F51.04Psychophysiologic Insomnia
F51.05Insomnia Due to Other Mental Disorder

F51 vs. G47 Codes

F51 SeriesG47 Series
Nonorganic sleep disordersOrganic or physiological sleep disorders
Behavioral or psychological causesMedical or neurological causes
Mental health-related insomniaInsomnia due to medical conditions or unspecified causes

Understanding this distinction helps medical coders select the most accurate diagnosis code and reduces the likelihood of coding errors.

ICD-10 Code F51.0 Nonorganic Insomnia (WHO vs. ICD-10-CM)

Another common source of confusion is the difference between WHO ICD-10 and ICD-10-CM, particularly regarding F51.0 Nonorganic Insomnia.

Although the codes appear similar, they are not identical.

WHO ICD-10

In the World Health Organization’s ICD-10 classification, F51.0 is the broader category for Nonorganic Insomnia.

It serves as a parent category and is not expanded into the same level of clinical detail used in the United States.

ICD-10-CM (United States)

The U.S. Clinical Modification (ICD-10-CM) provides greater specificity by dividing the F51.0 category into several billable diagnosis codes.

These include:

ICD-10-CM CodeDescription
F51.01Primary Insomnia
F51.02Adjustment Insomnia
F51.04Psychophysiologic Insomnia
F51.05Insomnia Due to Other Mental Disorder

This additional specificity allows healthcare providers and medical coders to document the patient’s condition more accurately for treatment, reporting, and reimbursement purposes.

Why This Difference Matters

Medical coders should avoid using the general WHO F51.0 category when coding under ICD-10-CM. Instead, they should select the appropriate billable child code that best reflects the provider’s documentation.

Documentation Requirements for Accurate Insomnia Coding

Accurate ICD-10-CM coding begins with clear and complete clinical documentation. Before assigning an insomnia diagnosis code, healthcare providers should document enough information to support the most specific code available.

Essential Documentation Elements

A provider’s documentation should include:

  • The specific diagnosis (e.g., primary insomnia, adjustment insomnia, or insomnia due to a medical condition)
  • Whether the insomnia is acute, chronic, or persistent (if clinically relevant)
  • The underlying cause, when known
  • Any associated medical or mental health conditions
  • The patient’s symptoms and their impact on daily functioning

Conclusion

Selecting the correct ICD-10 code for insomnia requires more than identifying sleep difficulties; it requires understanding the underlying cause documented by the healthcare provider. While G47.00, Insomnia, Unspecified remains the most commonly assigned diagnosis code, it should only be used when the medical record lacks sufficient detail to support a more specific classification.

When insomnia is linked to a medical condition, G47.01 is generally the appropriate choice. For nonorganic or behavioral insomnia, including primary insomnia (F51.01), adjustment insomnia (F51.02), or insomnia due to another mental disorder (F51.05), coders should select the code that most accurately reflects the provider’s diagnosis.

Get in touch