v3.26.1
N-2 - $ / shares
6 Months Ended
Apr. 30, 2026
Apr. 30, 2026
Oct. 31, 2025
Oct. 31, 2024
Oct. 31, 2023
Oct. 31, 2022
Oct. 31, 2021
Oct. 31, 2020
Cover [Abstract]                
Entity Central Index Key   0000065433            
Amendment Flag   false            
Document Type   N-CSRS            
Entity Registrant Name   THE MEXICO FUND, INC.            
Capital Stock, Long-Term Debt, and Other Securities [Abstract]                
Capital Stock [Table Text Block]  

6. Capital Stock:

On April 30, 2026, there were 150,000,000 shares of $1.00 par value common stock authorized, of which 14,420,065 shares were outstanding.

The Fund offers a Distribution Reinvestment and Stock Purchase Plan (the “Plan”) to its stockholders. Fund stockholders are automatically enrolled as participants in the Plan unless they notify the Fund’s transfer agent otherwise. During the six months ended April 30, 2026, the Fund did not issue shares under the Plan.

The Board has authorized the Fund to repurchase up to 10% of the Fund’s outstanding common stock in open market transactions during any 12-month period if and when Fund shares trade at a price that is at a discount of at least 10% to NAV. During the six months ended April 30, 2026, the Fund did not repurchase Fund shares in the open market.

           
Document Period End Date   Apr. 30, 2026            
Common Stock [Member]                
General Description of Registrant [Abstract]                
Share Price $ 21.14 $ 21.14 $ 19.39 $ 14.01 $ 15.10 $ 14.14 $ 14.97  
NAV Per Share $ 24.65 $ 24.65 $ 22.02 $ 17.61 $ 18.97 $ 17.62 $ 17.40 $ 12.66
Capital Stock, Long-Term Debt, and Other Securities [Abstract]                
Outstanding Security, Authorized [Shares] 150,000,000              
Outstanding Security, Not Held [Shares] 14,420,065