Patients requiring prolonged mechanical ventilation (PMV) are a subset of critically ill patients with high resource utilization and poor long-term outcomes. We sought to develop an algorithm for identifying patients receiving PMV, defined as either 14 or 21 days of mechanical ventilation, in administrative and claims data. The algorithm was derived in mechanically ventilated patients at an academic medical center (n = 1,500) and validated in patients with community-acquired pneumonia in a multi-center clinical registry (n = 20,370), with further evaluation in the Pennsylvania discharge database (n = 62,383). The final algorithm combined the International Classification of Diseases codes for mechanical ventilation, diagnosis related groups for ventilation and tracheostomy, and intensive care unit length of stay. In the derivation dataset the algorithm was highly sensitive (14 days = 92.4%; 21 days = 97.6%) and specific (14 days = 91.6%, 21 days = 92.1%). The definition continued to perform well in the validation dataset (14 days: sensitivity = 87.6%, specificity = 88.5%). In both the derivation and validation datasets the negative predictive value was over 95% and positive predictive values ranged from 60% to 70%. In state discharge data the algorithm identified a cohort of patients with high costs and frequent discharge to skilled care facilities. Administrative data can be used to accurately identify populations of patients receiving PMV.