Oral bacteria are known to be associated with perioperative complications during hospitalization. However, no presented reports have clarified the relationship of oral bacterial number with medical costs for inpatients. The Diagnosis Procedure Combination (DPC) database system used in Japan provides clinical information regarding acute hospital patients. The present study was conducted to determine the association of oral bacterial numbers in individual patients treated at a single institution with length of hospital stay and medical costs using DPC data. A total of 2369 patients referred by the medical department to the dental department at Hiroshima University Hospital were divided into the low (n = 2060) and high (n = 309) oral bacterial number groups. Length of hospital stay and medical costs were compared between the groups, as well as the associations of number of oral bacteria with Charlson comorbidity index (CCI)-related diseases in regard to mortality and disease severity. There was no significant difference in hospital stay length between the low (24.3 ± 24.2 days) and high (22.8 ± 20.1 days) oral bacterial number groups. On the other hand, the daily hospital medical cost in the high group was significantly greater (US$1456.2 ± 1505.7 vs. US$1185.7 ± 1128.6, P < 0.001). Additionally, there was no significant difference in CCI score between the groups, whereas the daily hospital medical costs for patients in the high group treated for cardiovascular disease or malignant tumors were greater than in the low number group (P < 0.05). Multivariate regression analysis was also performed, which showed that oral bacterial number, age, gender, BMI, cardiovascular disease, diabetes, malignant tumor, and hospital stay length were independently associated with daily hospitalization costs. Monitoring and oral care treatment to lower the number of oral bacteria in patients affected by cardiovascular disease or cancer may contribute to reduce hospitalization costs.