Subungual Hematoma
You just slammed the car door on your finger. The pain is nearly unbearable, and your nail has turned black and blue. It's likely you have a subungual hematoma. This is a pool of blood that collects under a nail after an injury. Although a nail hematoma is seldom serious, it can be very painful.

When to Go to the Emergency Room (ER)
Any severe blow to a finger or toe should be checked by your doctor. You may have broken bones or damage to other tissues. If you can't see your doctor right away, go to the nearest emergency department.
What to Expect in the ER
Your nail will be examined.
X-rays will likely be taken to check for a bone fracture or other injury.
To drain the blood from the hematoma and relieve pain, the doctor may make a small hole in the nail using a special lance or drill. The blood under the nail can drain out through this hole. The nail is then bandaged.
If the nail is badly damaged it may need to be removed. Deep cuts beneath the nail can then be repaired with stitches.
Follow-up
If the damaged nail isn't removed, it will most likely fall out on its own. A fingernail can regrow in as little as 8 weeks. Toenails take longer—about 6 months. See your doctor if you have any problems with the nail as it heals and regrows.