This paper presents the creation of a new simulation tool, MATACDC. It is the first open source program for power flow analysis of HVDC grids and hybrid AC/DC systems and uses state-of-the-art developments in the field of HVDC grids research. MATACDC is based on MATLAB and has been fully integrated with the AC system power flow routines from MATPOWER. The software includes all the models needed to study the steadystate interaction of AC and DC systems for a wide range of converter representations and control functions.Any combination of multiple non-synchronised AC systems and multiple DC systems can be solved. The code is freely available and is intended for researchers and students working in the field of HVDC grid steady-state interactions and HVDC grid operation. MATACDC can also easily be extended with user-defined functionality.The paper focuses on the program design and layout, the converter modelling, the practical implementation and the integration with AC power flow routines. Furthermore, different examples of possible user-defined functions show how the tool can be extended to include other control representations to study their effect on overall system interactions. Simulation results demonstrate the viability of the routines to simulate complex hybrid AC/DC systems.