In-packet Bloom filters are recently proposed as a possible building block of future Internet architectures replacing IP or MPLS addressing that solves efficient multicast routing, security and other functions in a stateless manner. In such frameworks a bloom filter is placed in the header which stores the addresses of the destination nodes or the traversed links. In contrast to the standard Bloom filter, the length of the in-packet Bloom filter must be highly adaptive to the number of stored elements to achieve low communication overhead. In this paper we propose a novel type of Bloom filter called Adaptive Bloom filter, which can adapt its length to the number of elements to be represented with a very fine granularity. The novel filter can significantly reduce the header size for in-packet bloom filter architecture, by eliminating the wasting effect experienced in existing block-based approaches which rely on concatenating several standard Bloom filters. Nevertheless, it requires slightly more calculations when adding and removing elements.