The 3D lawn-shaped N-doped porous carbon matrix/polyaniline nanocomposite is fabricated. Unique structure of carbon materials provides large deposition surface for polyaniline. The composite with 3D lawn-like structure reveals excellent electrochemical properties.