In this paper, the numerical solution of Poisson's equation in two-dimension (2D) of p-n junction of silicon has been carried out using Neumann and Dirichlet boundary conditions. Assumption of linearly grading impurities doping has been used for analysis of charge density. The calculation has been done for different dopant concentration rates of impurities. The aim of this calculation is to find out the profile of the potential and electric field within depletion layer.