In 5d transition metal oxides, novel properties arise from the interplay of electron correlations and spin--orbit interactions. Na4IrO4, where 5d transition-metal Ir atom occupies the center of the square-planar coordination environment, is synthesized. Based on density functional theory, we calculate its electronic and magnetic properties. Our numerical results show that the Ir-5d bands are quite narrow, and the bands around the Fermi level are mainly contributed by d_{xy},d_{yz} and d_{zx} orbitals. The magnetic easy-axis is perpendicular to the IrO4 plane, and the magnetic anisotropy energy (MAE) of Na4IrO4 is found to be very giant. We estimate the magnetic parameters by mapping the calculated total energy for different spin configurations onto a spin model. The next nearest neighbor exchange interaction J2 is much larger than other intersite exchange interactions and results in the magnetic ground state configuration. Our study clearly demonstrates that the huge MAE comes from the single-ion anisotropy rather than the anisotropic interatomic spin exchange. This compound has a large spin gap but very narrow spin-wave dispersion, due to the large single-ion anisotropy and relatively small exchange couplings. Noticing this remarkable magnetic feature originated from its highly isolated IrO4 moiety, we also explore the possiblity to further enhance the MAE.