We developed a Markov model to evaluate the cost-effectiveness of nivolumab in patients with advanced or recurrent esophageal cancer receiving second-line treatment in Japan. We assessed an incremental cost-effective ratio (ICER) for nivolumab versus docetaxel from the health insurers perspective. A threshold ICER was set at 7.5 million JPY. The ICER was calculated to be 12.45 million JPY per quality-adjusted life year, which was above the threshold. In a one-way sensitivity analysis, the results were most sensitive to the utility scores for nivolumab. If the cost of nivolumab per 240 mg could be reduced below 282,817 JPY or nivolumab could prolong the overall survival up to 4.1 months, the ICER fell below the threshold. The probabilistic sensitivity analysis revealed a 17.6 probability that nivolumab was cost-effective as compared to docetaxel. Our study suggests that nivolumab is not cost-effective in patients with advanced or recurrent esophageal cancer receiving second-line treatment as of this moment. Therefore, for future study, it is advisable to review drug prices and select patients who are expected to have high therapeutic effects.