We investigate the low-mass population of the young cluster IC348 down to the deuterium-burning limit, a fiducial boundary between brown dwarf and planetary mass objects, using a new and innovative method for the spectral classification of late-type objects. Using photometric indices, constructed from HST/NICMOS narrow-band imaging, that measure the strength of the 1.9 micron water band, we determine the spectral type and reddening for every M-type star in the field, thereby separating cluster members from the interloper population. Due to the efficiency of our spectral classification technique, our study is complete from approx 0.7 Msun to 0.015 Msun. The mass function derived for the cluster in this interval, dN/dlogM propto M^{0.5}, is similar to that obtained for the Pleiades, but appears significantly more abundant in brown dwarfs than the mass function for companions to nearby sun-like stars. This provides compelling observational evidence for different formation and evolutionary histories for substellar objects formed in isolation vs. as companions. Because our determination of the IMF is complete to very low masses, we can place interesting constraints on the role of physical processes such as fragmentation in the star and planet formation process and the fraction of dark matter in the Galactic halo that resides in substellar objects.